title: Android - What is wrong with onStart method?
body: <p>I am trying to understand Android Activity lifecycle. For that purpose, I have created Activity where I have overridden all lifecycle methods(onCreate, onStart, onRestart, onResume, onPause, onStop, onDestroy):</p>
  
  <pre><code>public class SecondActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_second);
          Log.d("ActivityTutorial", "onCreate");
      }
  
      @Override
      protected void onStart() {
          super.onStart();
          Log.d("ActivityTutorial", "onStart");
      }
  
      @Override
      protected void onRestart() {
          super.onRestart();
          Log.d("ActivityTutorial", "onRestart");
      }
  
      @Override
      protected void onResume() {
          super.onResume();
          Log.d("ActivityTutorial", "onResume");
      }
  
      @Override
      protected void onPause() {
          super.onPause();
          Log.d("ActivityTutorial", "onPause");
      }
  
      @Override
      protected void onStop() {
          super.onStop();
          Log.d("ActivityTutorial", "onStop");
      }
  
      @Override
      protected void onDestroy() {
          super.onDestroy();
          Log.d("ActivityTutorial", "onDestroy");
      }
  
  }
  </code></pre>
  
  <p>I put breakpoints on the lines where I am logging using Log.d(...). Then I tried to debug. onCreate method is okay - it is calling when activity is created. </p>
  
  <p>Strange situation is starting onStart method. According to Android <a href="http://developer.android.com/reference/android/app/Activity.html" rel="noreferrer">documentation</a>: "onStart() Called when the activity is becoming visible to the user." But when I debug, it comes to onStart method but Button which is on this Activity, not visible yet. </p>
  
  <p><a href="https://i.stack.imgur.com/2i1A7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2i1A7.png" alt="enter image description here"></a></p>
  
  <p>I thought it supposed to be seen onResume() - after calling onStart() method. But button was not visible. </p>
  
  <p><a href="https://i.stack.imgur.com/nGUU1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nGUU1.png" alt="enter image description here"></a></p>
  
  <p>Only after onResume method, button was visible.</p>
  
  <p><a href="https://i.stack.imgur.com/jkjke.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jkjke.png" alt="enter image description here"></a></p>
  
  <p>So my question is what is wrong with onStart and onResume methods? Maybe I am doing something not in the way it supposed to be done?</p>