문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top