Search This Blog

Thursday, 14 June 2012

How to handle the Back button event in Blackberry

Hello fellas,
              Wana do something on Backbutton click in your app??? like sending the app in background ,if in case you want your app always running.Here it is , as easy as 1 2 3 ...follow the code...

Code:

What you need to do is Override the 'onClose' method of that particular screen, like the main screen of your app....


public boolean onClose(){
//Do something on back button click
return true;
}


Now , suppose you want that your app should go in background and keep running on back button Click....Follow the Code...

public boolean onClose(){
UiApplication.getUiApplication.requestBackground();
return true;
}

2 comments: