开发者

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:

  1. Override the isDirty() method of your Screen (via: Blackberry - Disable Save option in BasicEditField?):

    public boolean isDirty() { return false; }

  2. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜