Is there an exit routine that will be called by the runtime every time a blackberry app signals that it wants to exit, similar to MIDlet.de开发者_C百科stroyApp(boolean)
for traditional midlets?
If none exists, how do you ensure for instance that a particular task gets executed just before a blackberry app exits?
I think you are looking for onClose() method
public class MyMainScreen extends MainScreen {
public MyMainScreen() {
super();
}
public boolean onClose() {
// Your code here
}
}
public boolean onClose()
Indicates a close event has occurred. The default implementation is activated by specifying DEFAULT_CLOSE. It will call onSavePrompt if the screen is dirty, then call close() if sucessful.
精彩评论