本文介绍了Android的TabActivity返回键事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想回去tabActivity时pressing后退按钮。 previously我做
I tried to go back when pressing back button in tabActivity. previously i did
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK)
showDialog(DIALOG_REALLY_EXIT_ID);
return true;
}
private void showlist() {
// TODO Auto-generated method stub
}
但这一事件在TabActivity从来没有所谓。我不知道如何摆脱tabActivity回来了,我是新到Android,任何人都可以给我请。
But this event never called in TabActivity. i dont know how to get back from tabActivity, I am new to android, can anyone give me pls.
推荐答案
您可以在选项卡中的活动覆盖onBack pressed()
You can override onBackPressed() in tab activity ,
有关更多详情或问题,你可能会遇到,检查这个帖子,
For more details or problem you might encounter , check this post,
这篇关于Android的TabActivity返回键事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!