Question

So I have a start game layout that is in landscape mode. When I click on button a or button b, a new activity starts depending on which button I click. When I click button a, I can add pictures to an imagebutton and edit the names of players. (I'm making a Volleyball App) Then when I go back to my start game layout and click on button a, all the images and textview containing the players name is back to what it was when a new game was created.

I want the info that I put in to be saved. What can I do?

Was it helpful?

Solution

The decision depends on should the data be saved if the activity is destroyed.

Usually saveInstanceState is used to save a data when the activity is going from landscape to portrait mode (or back).

If you will use Preferences, the data will be saved permanently, even if you shut down the phone.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top