mikeflores2000
Posts: 0
Joined: Sun May 06, 2012 11:09 pm

How can I override the back key to return to the last application used?

I'm running Android 4.0 and my app results in hot links displayed in the output.
Clicking a hot link sends me to another page but clicking the back key totally exits application.
How can I intercept or handle the Android back key to return back to my Tiggzi application?
Backbutton event handler in Tiggzi IDE cannot even display an alert. What did I miss?
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {

Code: Select all

     if (keyCode == KeyEvent.KEYCODE_BACK) { 
             //do what you want 
         return true; 
     } 
     return super.onKeyDown(keyCode, event); 
 }  

Image Image

Return to “Issues”