How could i avoid the SAVE dialog in my custom blackberry Application?
I am writing a blackberry application and pushing screens one after another(three in series)
Screen1 displays Screen2 and Screen2 displays Screen3
开发者_如何学编程When i press "Back Key" on my Blackberry Device i.e., bold 9700, its prompts a dialog box with Question mark image and buttons "Save" "Discard" "Cancel".
Why does this dialog appears? How can i avoid this dialog?
Please Help Thanks SIA
you can avoid this type of dialog by overriding onClose method for that screen :
public boolean onClose()
{
this.close();
return true;
}
There are two ways of doing this:
Override the isDirty() method of your Screen (via: Blackberry - Disable Save option in BasicEditField?):
public boolean isDirty() { return false; }
You can also override the onSavePrompt() method of your Screen (also via: Blackberry - Disable Save option in BasicEditField?):
protected boolean onSavePrompt() { return true; }
Simply Write this code in your specified class:
protected boolean onSavePrompt()
{
return true;
}
It will disable the Save Prompt Dialog Box.
精彩评论