Whi*_*e-E 6 android back-button
onPause()每当按下后退按钮时,我的理解,显然是错误的?现在在我的代码中我已经把这个onPause()事件:
@Override
protected void onPause(){
super.onPause();
if(!_END_GAME){
Builder _alert = new AlertDialog.Builder(this)
.setMessage("onPause, with game NOT over!");
_alert.setNeutralButton("OK.",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
arg0.dismiss(); // Kills the interface
System.runFinalizersOnExit(true);
finish();
}
});
_alert.setTitle("Your Score!");
_alert.show();
}
Run Code Online (Sandbox Code Playgroud)
}
现在的问题是,对话框没有启动任何一个,然后代码错误输出.我把对话框放在那里试图可视化onPause(调用的位置,并帮助我调试其他一些变量等.但就像我说的那样,它甚至都没有显示出来.任何想法为什么会这样?是否有onPause()按下后退按钮之前启动的功能?提前感谢您提供任何信息.
| 归档时间: |
|
| 查看次数: |
7856 次 |
| 最近记录: |