开发者

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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜