欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

游戏退出,安卓停止线程抛出异常

程序员文章站 2022-04-24 19:10:02
@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() {// �[�