Is there an alternative onBackPressed method for TabActivity ?

need tabActivity to make a dialog box for the Back button

    1 answer 1

    Add the following code to your TabActivity:

     @Override public void onBackPressed() { this.getParent().onBackPressed(); } 

    Now you can use onBackPressed with your TabActivity:

     @Override public void onBackPressed() { // Called by children } 

    By default, the descendants of the activity intercept the event and it does not reach the TabActivity.

    Source: https://stackoverflow.com/questions/2796050/key-events-in-tabactivities