I am just getting into Android development and I have a question about
how to save form data when a user leaves an activity.
I am coming to this from Blackberry development, so I will use that as
my example for my question. On the blackberry when the user tries to
leave the screen if any fields on the screen have changed then the
user will be prompted to save/discard/cancel. The developer overrides
the correct methods and saves the data.
From what I can tell, this doesn't happen in the Android world. It
seems like a bad idea to prompt the user in the onStop or onPause
methods of the activity because these can be called if you app is
being shut down for memory reasons (or that is what I gather from the
API docs). So what do I do?
Only save the data when the user specifically presses a save button?
Auto save? If I auto save or save every time the activity is closed
then I have to worry about bad data and the user may not want to save.
Just wondering what the accepted process is.
Thanks.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment