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.
精彩评论