Android: Saving custom button and spinner
- by Jacob Huggart
Hello All,
I am new to Android programming and was handed a fairly large program that is almost complete, but needed support for switching between portrait and landscape view. I added android:configChanges="keyboardHidden|orientation" to the manifest and used onConfigurationChanged to save the view data and that works. However, there is a button that displays the date selected (when pressed a calendar to select the date comes up) and a spinner that displays the current view and is used to select a new view. Those two items are being cleared/reset and do not work at all after the screen flip.
I have been attempting to use onSaveInstanceState and onRestoreInstanceState to fix that, but I cannot figure out how to get it to work. Any advice?