为什么我的后退按钮在 Google map Activity 中不起作用? 已经包括:
@Override
public void onBackPressed() {return;}
但是还是不行。
最佳答案
你需要这个:
@Override
public void onBackPressed() {
super.onBackPressed();
}
或者这个 API 级别 5 之前的版本:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_BACK) {
// your implementation here
// finish(); - to exit the Activity
return true; // shows you consumed the event with your implementation
}
return super.onKeyDown(keyCode, event);
}
关于java - "Back"启动mapview Activity 时不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9970918/