I have an offline-online application, i found a strange issue in it, may be it is not, but i did'nt understand about it..  

App requirement is that, if internet is available, even from starting app or from resuming, i call webservices and store data in sqlite, otherwise app stays in offline mode,  

I have 2 activities, second activity contains an id, that i passes through intent (that point is important),  

**My Problem:**  

if i am in second activity, and internet is running, and i press home button , then this 2nd activity pauses, then stop which is a default behavior in android, i goto settings, turn wifi off, then press app **icon** again to get back in my app, here i got confused, i expect that my app now will be in **onResume**, but when i see in logcat its **onCreated** called and app
crashes, nullPointerException occurs, because this 2nd activity does not have that id, i passed through intent.. 

**Note:**  

If i use recent app button to go to "settings", then come back again after turing wifi off, and repeat all this behavior, then working fine, its onResumes called not oncreate..

**My Question**  

Why it is going in onCreate while i my expectation is to be onResume while i came back from app icon?