How to save current activity's status when some other activity comes to
the foreground
I am building my first android app, which is a board game consisting of
ImageViews (draggable), ToggleButton (turns sound ON/OFF), TextViews (for
scores), ArrayList, booleans, integers, strings, floats, and some doubles.
If I press back button to go to main menu, and try to come back to the
game I was playing, it crashes. I am not implementing any of onPause,
onStop, onRestart, onResume. I have only implemented onCreate. I went
through few posts in this site, but all answers were confusing. Shoud I be
using onPause and onResume OR onSaveInstanceState and
onRestoreInstanceState to save my current game state (all the data types
and objects). An example would be really appreciated.
Thanks in advance!!
No comments:
Post a Comment