1

I want to know how can I save state of a page(Activity) so when I come back to that page it should be in state in which I left it. for eg if I checked a checkbox in page so after leaving that page when I come back that checkbox should be checked as I left. thanks in advance

Arun Badole
  • 10,977
  • 19
  • 67
  • 96
  • I think this can help you http://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state – dev mz Jul 21 '11 at 14:12

2 Answers2

0

If you are talking about a case where another Activity interrupts the current one then you should look into managing the Activity lifecycle http://developer.android.com/guide/topics/fundamentals/activities.html#Lifecycle onSaveInstanceState(), onRestoreInstanceState() or in onPause() and onResume().

If this is for persistent data storage then SharedPreferences / DB or some other form of storage would be required: http://developer.android.com/guide/topics/data/data-storage.html

source.rar
  • 8,002
  • 10
  • 50
  • 82