project_files/Android-build/SDL-android-project/src/org/hedgewars/mobile/MainActivity.java
author Xeli
Tue, 09 Aug 2011 20:56:34 +0200
branchhedgeroid
changeset 5514 294c92eea729
parent 5416 26a36326d199
child 5621 ea796c83ea47
permissions -rw-r--r--
fixed minor download bug
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
     1
package org.hedgewars.mobile;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
     2
5416
26a36326d199 Added a small example of the frontend still being worked but commited so the downloader now works
Xeli
parents: 5397
diff changeset
     3
import org.hedgewars.mobile.Downloader.DownloadActivity;
26a36326d199 Added a small example of the frontend still being worked but commited so the downloader now works
Xeli
parents: 5397
diff changeset
     4
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
     5
import android.app.Activity;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
     6
import android.content.Intent;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
     7
import android.os.Bundle;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
     8
import android.view.View;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
     9
import android.view.View.OnClickListener;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    10
import android.widget.Button;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    11
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    12
public class MainActivity extends Activity {
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    13
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    14
	Button downloader, startGame;
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    15
	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    16
	public void onCreate(Bundle sis){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    17
		super.onCreate(sis);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    18
		setContentView(R.layout.main);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    19
		
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    20
		downloader = (Button)findViewById(R.id.downloader);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    21
		startGame = (Button)findViewById(R.id.startGame);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    22
		
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    23
		downloader.setOnClickListener(downloadClicker);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    24
		startGame.setOnClickListener(startGameClicker);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    25
	}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    26
	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    27
	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    28
	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    29
	private OnClickListener downloadClicker = new OnClickListener(){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    30
		public void onClick(View v){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    31
			startActivityForResult(new Intent(getApplicationContext(), DownloadActivity.class), 0);
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    32
		}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    33
	};
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    34
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    35
	private OnClickListener startGameClicker = new OnClickListener(){
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    36
		public void onClick(View v){
5416
26a36326d199 Added a small example of the frontend still being worked but commited so the downloader now works
Xeli
parents: 5397
diff changeset
    37
			startActivity(new Intent(getApplicationContext(), StartGameActivity.class));
5397
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    38
		}
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    39
	};
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    40
	
4ae1b082e4ba Added download functionality and changed some icons
Xeli
parents:
diff changeset
    41
}