I don't believe it is called minimization, but basically when the user navigates away from my game, is there an easy way to pause it? The only thing I know of is bundles, IE restoreState(Bundle savedState)
The problem is, I find myself trying to all sorts of logic problems on variables like this:
xGrid = new float[savedState.getFloatArray("xGrid").length];
yGrid = new float[savedState.getFloatArray("yGrid").length];
xGrid = savedState.getFloatArray("xGrid");
yGrid = savedState.getFloatArray("yGrid");
Is there an easier way like just stopping the thread and resuming it when they return? This is awfully annoying, considering my app is still in development and I have to update this every time I add a variable. I know i'm a lazy programmer, but... that's the point of programming right? (To be lazy.)
There is no easy way tom , you will need to store all your data , possibly even to a file/database and it will be a great feature to return to a game after a few days , even after a restart.
The reason you have to store data is Android handles the memory,due to which it can decide to kill your app in an attempt to free memory.
Check out Activity.onPause() and Activity.onResume(). If you need to save persistent state, check out the docs on that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With