Blackberry - disable save function in BasicEditField?

I use basiceditfield to input user input to do a simple string search. But if I type a few letters and want to return without continuing the search, he will automatically ask me whether to save the contents of the field. I do not want this to happen. Can I somehow disable the "Changes made! -Save-discard-cancel" option in basiceditfield (or any edit field)? Please, help!!!

+4
source share
3 answers

Try adding this to your MainScreen class:

protected boolean onSavePrompt() { return true; } 
+6
source

Another way would be to override the dirty state logic in your Screen class as follows:

 public boolean isDirty() { return false; } 

Of course, you can also just override the same method in a subclass of your field, and this should work too. (assuming you still want to do dirty tracking of the status of other fields on the screen.)

+2
source

change onClose screen method

  public boolean onClose() { this.close(); return true; } 
+1
source

Source: https://habr.com/ru/post/1304346/


All Articles