Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to handle "save" and "cancel" buttons and the back key
    text
    copied!<p>I am wondering how to handle user input forms in my app. (real budget lite). Right now this is what I am doing, but I am not sure if this is the best practice:</p> <p>I have two soft buttons on most of my activities that take user input: "save" and "cancel".</p> <p>"save" captures the user input and then finishes the current activity "cancel" abandons any user input and finishes the current activity Hitting the back button on the device does the same thing as "save"</p> <p>It still bothers me a little that the back button performs the function "save and go back". Users who are new to android phones are probably used to web browsers, where the back button means "forget about this page and go back to the previous page". If you were buying something online and you got to the final "purchase" page, you would not expect the back button to complete the purchase, would you? But it seems like that behavior is the way that the built-in applications work, so I am not inclined to do it differently.</p> <p>Anyway, I have looked through the official documentation and I cannot find this behavior explicitly spelled out. Can someone point me to the right place, or at least provide some guidance as to best practice?</p> <p>The choices as I see them are:</p> <ol> <li>Do it the way I am doing it now.</li> <li>Get rid of the "save" button and count on the users knowing that back equals save.</li> <li>Get rid of both buttons and provide a cancel feature from the menu key.</li> </ol> <p>The google contacts app provides the buttons "done" and "revert", by the way. I guess "revert" means cancel; is there a difference? Maybe I should have my buttons labeled "done" and "revert" instead of "save" and "cancel"? In gmail, the menu button provides the choices "save draft" and "discard". It seems to me that we would be doing the users a favor if we had some consistency here.</p> <p>Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload