0
How to save instance state and use saved instance state in android?
I have created an app, in which there are two text views and two buttons. Clicking on first button displays a city from array of four city and clicking on second button displays language of city in first textview. But when i rotate the screen, values inside the textviews get lost. I know that onSaveInstance state() will. help me to overcome this issues but i don't know how to use it. can any one help me??? Hope someone will. Thanks alot in advance.
1 Resposta
0
Override onSaveinstance and put the two string values of textviews into the outstate bundle. Then in onCreate or onRestoreinstance get the strings from the bundle and set them back.