Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
05-28-2013 07:05 AM
Exiting an app with System.exit() appears to hang the app, until some event occurs (screen backlight time-out, for example), at which point the app dies with one of a number of errors (like "unable to find process" or "failed looking up window").
This does not happen if the app never switches activity. If the app switches to another activity and then back, exit() will no longer terminate the app correctly.
(Same code works 100% of the time on a wide variety of Android devices, from 2.0 to 4.2.)
Is there a definitive way to terminate an application?
05-28-2013 11:03 AM
Android isn't really designed for this.
Why do you want to terminate the application manually, instead of letting the Android runtime do it for you?
05-28-2013 01:24 PM
Android is designed to do this. exit() is clearly specified by the Android API, and all implementations of Android in my (significant) experience conform that specification. Android does it perfectly - it is only the BB Android player that has a problem. Actually, I should say that the same code has been working fine on the PlayBook for the last year as well. It's the Q10 that exhibits this issue (and presumably the Z10).
I want to do it, because this is what the application already does, and I don't want to change it anymore than is necessary to get it to work on the '10. If supporting the '10 is costly, we simply won't bother for such a small user base.
I've managed to get it to behave better by calling finish() on the current activity, and by adding android:launchMode="standard" to all the activity definitions in the manifest. Now, roughly three out of four times the app will exit. The other times, it minimizes, but does not die. When maximized, it resumes to a blank screen. It can be killed manually from the task manager. This can happen whether or not there has been an activity switch, so my previous assertion that an activity switch was necessary to stop it exiting may have been incorrect.
05-28-2013 02:17 PM
I'm sorry, I didn't mean that it couldn't be done, merely that the design of Android is to use the lifecycle methods instead.
There's a great discussion about it here:
Are you running 10.1 builds on your Q? Or something older?
05-29-2013 10:49 AM
You may want to file a bug here:
That way, you can provide your APK for the devs to test against.
05-31-2013 02:34 PM
I have been told that there was a bug in the web page's cookie. If you clear your cookies and try again, it should work.
Let me know if you see an error and we'll get it resolved.