03-04-2010 08:09 AM
Could someone explain why "menu, close" seems to do the same thing as "escape"? Why doesn't "close" actually close the app? Actually, maybe a better question is what is the point of "close"? My guess is that bb users either (A) hit the power button to close apps (and many probably don't understand the memory implications) or (B) quickly tap escape a few times when they don't want the app running in the background. I think backgrounding on the BB is awesome, but I'm confused by "close" and the fact there is no quick standard way to close an app. I haven't used the BB that much honestly so maybe I'm overly paranoid about memory use. However a quick search does reveal BB users who don't understand why things suddenly start disappearing on their phones.
03-04-2010 09:22 AM
i never encountered these problems. most users know how the BB works, and all native software has the same behavior.
the escape key calls close on a screen per default, closing the last screen calls System.exit.
the red key requests background.
as a developer you can overwrite this behavior.
03-04-2010 01:53 PM
I'm not sure you understand how the feature actually works. Hitting menu -> close DOES in fact close the application. There are some applications that cannot be closed, for example the mail client on the 9700, and so hitting close will send them to the background. All 3rd-party applications, as well as non-persitant RIM applications, will exit when menu -> close is selected. This has been my experience with the 9700 -- I cannot confirm this behaviuour on other devices, though it is assumed to be the case. As a quick test, start an app (say, the media play) and hit back/escape. Then hold menu to bring up the task switcher. The application will still be running, just in the background. Now switch to that application and select close from the menu. Hold down the menu key to bring up the task switcher and you will see that the application is no longer in the ribbon.
Hope that helps,
~Dom
03-05-2010 03:07 AM
not correct. hitting close closes the current screen. it this screen is the last on the stack the application is closed (system.exit). try it by pushing two screens and hitting close on one -> the other is still there.
On my phone (8900 5.0.0.509) i go to media and open the music icon. Close and escape key to the same for me -> close the app. Hitting the red key puts it to the background.
03-08-2010 10:38 AM
As simon_hain pointed out, you're wrong.
I'm still left with the same question. Why do I need "close" when I can hit "escape" and get the same affect more quickly? Now, given that fact, why shouldn't "close" actually close the app? (from ANY screen that is. I realize it will in fact close it if there is only one screen on the stack). This would give a more savy bb user the ability to ensure they are keeping memory freed up.
AFA what other apps do, one thing i know for sure is that bb 3rd party apps in general tend to do what they want - they aren't nearly as standardized as say the iPhone. Some relevant example apps:
iStockManager (TD Ameritrade): does exactly what I'm suggesting. Close gives a "Are you sure" dialog and closes the app.
eBay: also closes from any screen but I suppose that's cuz it's browser based. This raises another question: should a bb user need to think "Hey, I'm in a web app. "close" will behave differently here"?!?!?!
ScoreMobile: doesn't have a "close" but adds a "quit" which quits the app from any screen.
Files: ( which i assume is a standard bb app). "close" actually closes the app. So is this a case where even bb is saying I have a valid point here?
Given how non-standard the behavior is, I feel like I'm probably free to do what I want in this case.
03-08-2010 11:01 AM
close is redundant as it does the same as the escape key, but i don't think thats bad.
i have implemented a dialog with "exit/run in background/cancel" in some apps and i think it is a good idea for most.
03-08-2010 12:12 PM
"close" is often so buried in the menu I doubt it gets used. Anyway, I've decided to have "close" actually close the app, and in case anyone wonders, this is how I did it:
public boolean keyChar(char key, int status, int time) {
if (key == Characters.ESCAPE) {
super.close();
return true;
} else {
return super.keyChar(key, status, time);
}
}
public void close() {
System.exit(0);
}
03-08-2010 03:23 PM
I should mention that, in the above solution, calling "super.close" eliminates all "save,discard,cancel" dialogs that would occur from hitting "escape". You could call "super.onClose()" here and you would get them. However, the problem is that hitting "discard" in this dialog appears to call "close()" which would close the app using the above code. In hindsight, it is probably better to remove "close" from the menu and implement an "Exit" menu item.
03-08-2010 03:51 PM
it should also be pointed out that the standard way to eliminate the close menu item breaks the ability to use addMenuItem/removeMenuItem (at least for me it stopped working). I need this because I have menu items that vary depending on what is selected on a screen.