开发者

Android TabActivity Back key Event

开发者 https://www.devze.com 2023-02-24 09:26 出处:网络
I tried to go back when pressing back button in tabActivity. previously i did public boolean onKeyDown(int keyCode, KeyEvent event) {

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

}

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.


You can override onBackPressed() in tab activity ,

For more details or problem you might encounter , check this post,

Key Events in TabActivities?

0

精彩评论

暂无评论...
验证码 换一张
取 消