title: How can I know that OnResume comes after onCreate?
body: <p>I have few activities and from one activity I open another and that go back to the first one...</p>
  
  <p>The point is onCreate is called ones , and onResume every time when the activity is show. For example when I close B that was previouslly started from A, the onResume is called but not onCreate....</p>
  
  <p>my problem is that I do not want to run the onResume if it comes after onCreate, I want to run the code only if onCreate wasn't called</p>
  
  <p>Is this possible to do WITHOUT static flag ?</p>
  
  <p>is there some method or flag from android like comesAfterOnCreate  ?</p>
  
  <pre><code>@Override
  protected void onResume() {
     if(comesAfterOnCreate){
         //DO not run this code
     }else{
        //run the long task
     }
  </code></pre>
  
  <p>I show a lot of answers with solution using static flag, Thanks to all of you for the effort and offering the help, but I was interested is there some method or something...</p>