Android spinner value gets lost when i open new activity?
Android spinner value gets lost when i open new activity and come back from that activity to my previ开发者_开发知识库ous one.how do i retain my spinner index?
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
You can override the onSaveInstanceState and onRestoreInstanceState methods in the Activity class and save/restore the value of your index.
http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle)
精彩评论