I've got a simple native application for debugging,
only displaying a triangle slowly changing the color.
Now, when i press the home-button and put my app into background
and then start it again, it is completely restarted.
How can i resume the old state?
I already tried to do it like in the native-app-example
with:
app->userdata = &my_state;
if (app->savedState != NULL)
my_state = *(State*)app->savedState;
and in handle_cmd
with:
case APP_CMD_SAVE_STATE:
app->savedState = malloc(sizeof(State));
*((State*)app->savedState) = my_state;
app->savedStateSize = sizeof(State);
break;
where State
is class with all things i want to save.
How could i do this?