2

In android , after lock and unlock the mobile, the activity get pause and resumed. On that time listview become empty.Pls help me to save values in onPause and retrieve that in onResume...

Thanks in advance

Siva
  • 21
  • 5
  • Have you looked at the Android Notepad tutorial? Steps 3-8 cover saving and restoring instance state. http://developer.android.com/resources/tutorials/notepad/notepad-ex3.html – Drooling_Sheep Mar 20 '12 at 05:15
  • Hi thanks for ur comment...actually i want to save the Arraylist(which fill listview) in onPause and Retrive that in onResume... thanks again – Siva Mar 20 '12 at 08:12

1 Answers1

2

Try putting the contents into the listview in onResume() instead of your onCreate() or some other method. Or even saving the instance is an option as @Drooling_Sheep said.

Rajkiran
  • 15,845
  • 24
  • 74
  • 114
  • Hi thanks for ur answer...actually i want to save the Arraylist(which fill listview) in onPause and Retrive that in onResume .... Thanks again – Siva Mar 20 '12 at 08:10