Android Question Screen orientation

Nitin Joshi

Active Member
Licensed User
Hi,
My APP includes 8 buttons. I change the text from "On" to "Off" and vice versa when user clicks the button. However, when I change the scree orientation, states of the button do not remain same, it reverts back to the status when APP was started.

Please help to resolve.

I have used 2 variants (320x480 & 480x320) in designer.
 

udg

Expert
Licensed User
Longtime User
Have a look at the Activity life-cycle video.
When the orientation is changed, the UI is destroyed and reconstructed so you have to save current state for components that need it (in your case the button text and, eventually its Tag property). Searching the forum you'll find a ready-made solution for saving/restoring items state.. StateManager
 
Upvote 0
Top