Resuming an app

Monkey Targets Forums/Android/Resuming an app

TennisPlayer(Posted 2012) [#1]
Does anyone know if there is a setting somewhere that allows an app to automatically resume from where you left off after exiting the app?

Thanks


benmc(Posted 2012) [#2]
I think that it should automatically do this with Monkey unless you have it doing something in OnSuspend that prevents it. My apps come right back in where you left off usually.

The other thing to check is your manifest.

Check the following settings to see if they are what you want in your main <activity>

android:clearTaskOnLaunch=["true" | "false"]
android:stateNotNeeded=["true" |false"]
android:launchMode=["multiple" | "singleTop" | "singleTask" | "singleInstance"]

For a list of other settings, look here:

http://developer.android.com/guide/topics/manifest/activity-element.html


Zurrr(Posted 2012) [#3]
If by exiting you mean true exit ( by you or force exit by task manager ) you have no choice but to save all the state and load again during your first loading the app. use savestate for that purpose. In your game you need to savestate at certain checkpoint or something. When app load at first you check available savestate status and resume game from there if exist


TennisPlayer(Posted 2012) [#4]
To clarify, I didn't really mean a true exit, but just getting out of and getting back to an app that was already in progress. Thanks benmc, I finally managed to fix the problem!


benmc(Posted 2012) [#5]
What did you have to change?


TennisPlayer(Posted 2012) [#6]
I had to change the launch mode because I think the app was creating a new instance of itself each time it was resumed, so it would restart at the main menu of my app. Now it just resumes where it left off last.