开发者

How to save the state of Spinner in onSaveInstanceState when changing the orientation in android

I want to save the state (ie. content) of spinner tied to an Adapter when chnaging the orientatio开发者_运维百科n. I am using onSaveInstanceState(Bundle savedInstanceState) and onRestoreInstanceState(Bundle savedInstanceState) method . Will u give the step by step process how to save the content?

Thanx


Here is an excellent example of how to do this (look at onPause & onResume), Spinner Example. I would strongly suggest also adding activity testing (aka unit testing) to make sure you restore all your states around the lifecycles. unit test example.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜