I want to close the background thread when user click power off button.
The main screen is disappear when the button is clicked later the browser screen is appear.
how to stop the Ui background thread .
and
what’s the keycode for power off button on blackberry.?
pls reply me…
Try to use
(char) Keypad.KEY_ENDkeycode to catch power off button click.In thread you can use
boolean isCancelledflag with somewhileandifin thread code to interrupt it by settingtruevalue. See Using Threads in J2ME Applications. Remember to clean up thread connections