I am working on an application that targets Api 19, and this is basically a sketch of the processing.
The problem that I encountered is that when I first launch my application immediately after installing it, it works well until the user sends it to the background. Then, if they click the application icon again, onCreate () is called, but the action is not destroyed or does not restart. Some variables change and cause strange behavior.
This happens ONLY when you first use the application. After the forced closure, this behavior will no longer be repeated (as far as I checked). And this does not happen when starting the application from Eclipse.
To summarize, this is what happens after the close of the first force (and what I think is right):
And this is what happens - ONLY - when you first start the application after installation:
The work is being done.
Activity is sent back through the home button
Onpause ()
We click on the application icon again
onCreate () <- !! note no onDestroy ()
onResume ()
Interestingly, the fact that I am using Immersive Mode has something to do with it, but changing the target version of Api to 10, removing Immersive mode, or testing on older devices does not help. Of course, I used android: configChanges = "orientation | keyboardHidden | screenSize" in my manifest.
Does anyone know what might cause this? Is this a common problem or should I look for an error in my code? Could there be a processing error?
. , . .
Update:
, , , . : https://code.google.com/p/android/issues/detail?id=26658
, , onCreate() , :
if (!isTaskRoot()) {
finish();
return;
}