Android documentation states that regarding the onCreate method:
Called when the activity is first created. This is where you should do all of your normal static set up: create views, bind data to lists, etc. This method also provides you with a Bundle containing the activity's previously frozen state, if there was one. Always followed by onStart().
However I have a strange behavior:
- I have an Activity A. When I start my application, onCreate is called. That's normal.
- I then press the home button. onStop is called. That's normal.
- I go back to my application, onCreate is NOT called. That's normal.
- I press home again.
- I go to another application (dropbox, gmail or whatever) to access a file with an extension that is associated to my application (I have an intent-filter with a pathPattern to this file extension)
- I select this file to open it to my app. onCreate is called though onDestroy has never been called. Why is that ? If I set a boolean in my activity to check if this is the first time that I call onCreate, this boolean says true twice (the very first time, and the second time when opening the app using the file extension).
I guess I misunderstood something with the onCreate. But the doc doesn't help me. Any idea ?