I am working on handling the change of screen orientation. In my onSaveInstanceState() method, I wanted to pass the ListAdapter itself in, and then read it back out in onCreate(). Is this the best way to handle an orientation change, or do I have to pass an ArrayList of all the objects in the listadapter, and use it to repopulate the listAdapter in onCreate()?
Asked
Active
Viewed 551 times
2 Answers
0
you can use below code in activity tag in manifest file
android:configChanges="keyboardHidden|orientation|screenSize"
or you should pass a arraylist from your objects in the listadapter and for passing arraylist you should parcle it .see my code here Android Parcelable Implementation with ArrayList<Object>

Community
- 1
- 1
0
You don't need to save ListView, you just had to store the data with which you are populating your ListView.
I hope this will help you out surely.
Thanks

SALMAN
- 2,031
- 1
- 20
- 18