Android: Return to previous state when re-opening application
I'm working on QML application which has several "screens" (splash screen then login then main view, etc..). But when I switch to another application (or android home screen) and switch back to my application, it returns to the splash screen.
I assume this is because the entire application is just one android activity, but is there a way to know, through Qt or C code, when the activity is being suspended and resumed? So that I could return to the last state my application was in.
are you sure it is suspended and not exited and restarted?
You could try to set the "launch mode parameter":http://developer.android.com/guide/topics/manifest/activity-element.html#lmode to singleInstance.
thanks for the reply!
It seems it does indeed exit, with this error:
E/libEGL (32084): eglDestroySurface:445 error 300d (EGL_BAD_SURFACE)
I get the same error with a sample QML application (SameGame example from QtCreator).
I googled around and can't find much of use about this -- any ideas?
All I can find is that it might be a problem with the app not implementing onPause() and onResume() functions properly, but I'm not sure how I might implement those myself.