Reputation: 11944
Android spinner value gets lost when i open new activity and come back from that activity to my previous one.how do i retain my spinner index?
Upvotes: 0
Views: 336
Reputation: 4829
use activity life cycle methods to save the state of the Activity and restore the Activity state to the previous state. those methods are onPause(), onResume()
http://developer.android.com/reference/android/app/Activity.html follow this link
Upvotes: 1
Reputation: 4784
You can override the onSaveInstanceState and onRestoreInstanceState methods in the Activity class and save/restore the value of your index.
Upvotes: 1