Is It Possible To Save Previous Activity?
Solution 1:
Pressing the back key kills your current activity. A user would not expect it to be saved as there is no way to go "Forward" .
You can save the important parts of your activity in SharedPreferences or a database when you press back and restore it to its previous state when the activity next starts which would give the impression that it was "saved"
Solution 2:
Activities are created in a stack, when you create A from B then B is now at the top of the stack, when you press the back button you are telling android that the top level of the stack (current activity) is no longer needed and it gets removed.
You will have to save state yourself and restore it if that's what you need to do when B is recreated.
one way you can use sharedpreferences
for saving state of TextView,EditView ...etc.and resigning again when activity recreated.
Thanks.maybe helpful :-)
Post a Comment for "Is It Possible To Save Previous Activity?"