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.
06-08-2009 10:46 PM
Solved! Go to Solution.
06-08-2009 11:19 PM - edited 06-08-2009 11:20 PM
Override onSavePrompt() and put up your own dialog.
Anyway, onSave() is never called if the user cancels the save prompt.
06-08-2009 11:27 PM
06-08-2009 11:38 PM - edited 06-08-2009 11:42 PM
So like I said, override onSavePrompt and put up your own prompt. onSavePrompt is responsible for calling onSave - so if the user cancels, you don't call it:
protected boolean onSavePrompt()Invoked when the screen should prompt to save its contents.
The default implementation is empty. Overriding classes should provide a dialog and call onSave if the user has chosen to save. If the return is true, the framework will call onClose.Returns: True if the screen should close; otherwise, false Since: JDE 3.6.0 See Also: MainScreen.onSavePrompt() Category:
06-08-2009 11:42 PM
06-08-2009 11:46 PM - edited 06-08-2009 11:46 PM
"Save" calls onSave. "Cancel" does nothing, just closes the prompt. "Discard" closes the screen without calling onSave.
Put up your own dialog, and act according to the user response.
06-09-2009 01:28 AM
06-09-2009 01:45 AM
Yes, the post above is correct, it resolved my problem.
Somehow, in my testing I saw that Save() was called on both "Discard" and "Save" actions, this got me confused. But re-testing it again produced expected results. I just did something wrong before and was not paying attention.