www.pudn.com > Mine.zip > Main.java, change:2009-10-08,size:842b


package org.yexing.android.games.mine;

import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;

public class Main extends Activity {

	GameView gameView;
	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		gameView = new GameView(this);
		setContentView(gameView);
	}

	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		gameView.gameState = GameView.STATE_LOST;
		super.onPause();
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		// TODO Auto-generated method stub
		gameView.onKeyDown(keyCode, event);
		return super.onKeyDown(keyCode, event);
	}
	
	@Override
	public boolean onKeyUp(int keyCode, KeyEvent event) {
		// TODO Auto-generated method stub
		gameView.onKeyUp(keyCode, event);
		return super.onKeyUp(keyCode, event);
	}

}