游戏退出,安卓停止线程抛出异常
程序员文章站
2022-07-08 18:30:49
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getW ......
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
// ȫ���ö�
prepare(0);
game = new Thread(thread);
thread = new GameThread();
game.start();
}
@Override
protected void onRestart() {
super.onRestart();
ExitGame = false;
}
@Override
protected void onPause() {
// thread.stop();
super.onPause();
}
@Override
protected void onDestroy() {
super.onDestroy();
// mOrientationListener.disable();
}
class GameThread implements Runnable {
Message msg;
boolean exitflag = false;
@Override
public void run() {// �[�