title: Activity life cycle methods : onPostResume significance
body: <p>Official documentation about <a href="https://developer.android.com/guide/components/activities/activity-lifecycle.html" rel="noreferrer">Activity</a> lists out 7 life cycle methods. </p>
  
  <p><code>onPostResume()</code> was not quoted as life cycle method.</p>
  
  <p>But I feel that this method is important method. </p>
  
  <p>During the life cycle, when an activity is visible from hidden to show state, </p>
  
  <pre><code>onRestart()
  onStart()
  onResume()
  onPostResume()
  </code></pre>
  
  <p>have been invoked in order.</p>
  
  <p>My code snippet:</p>
  
  <pre><code>package ravindra.projects.my_app_1;
  
  import android.content.Intent;
  import android.content.IntentFilter;
  import android.os.PersistableBundle;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  
  import android.widget.TextView;
  
  
  public class MainActivity extends AppCompatActivity implements View.OnClickListener{
  
      private EditText txtUserName;
      private EditText txtPassword;
      Button  loginButton;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          Log.d("Ravi","Main OnCreate");
          txtUserName=(EditText) findViewById(R.id.username);
          txtPassword=(EditText) findViewById(R.id.password);
          loginButton =  (Button)  findViewById(R.id.login);
          loginButton.setOnClickListener(this);
  
      }
  
      @Override
      public void onClick(View view) {
          Log.d("Ravi", "Login processing initiated");
          Intent intent = new Intent(this,LoginActivity.class);
          Bundle bundle = new Bundle();
          bundle.putString("userName",txtUserName.getText().toString());
          bundle.putString("password",txtPassword.getText().toString());
          intent.putExtras(bundle);
          startActivityForResult(intent,1);
         // IntentFilter
      }
      public void onActivityResult(int requestCode, int resultCode, Intent resIntent){
          Log.d("Ravi back result:", "start");
          String result = resIntent.getStringExtra("result");
          Log.d("Ravi back result:", result);
          TextView txtView = (TextView)findViewById(R.id.txtView);
          txtView.setText(result);
      }
  
      @Override
      protected void onStart() {
          super.onStart();
          Log.d("Ravi","Main Start");
      }
  
      @Override
      protected void onRestart() {
          super.onRestart();
          Log.d("Ravi","Main ReStart");
      }
  
      @Override
      protected void onPause() {
          super.onPause();
          Log.d("Ravi","Main Pause");
      }
  
      @Override
      protected void onResume() {
          super.onResume();
          Log.d("Ravi","Main Resume");
      }
  
      @Override
      protected void onStop() {
          super.onStop();
          Log.d("Ravi","Main Stop");
      }
  
      @Override
      protected void onDestroy() {
          super.onDestroy();
          Log.d("Ravi","Main OnDestroy");
      }
  
      @Override
      protected void onPostResume() {
          super.onPostResume();
          Log.d("Ravi","Main PostResume");
      }
  
      @Override
      public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
          super.onSaveInstanceState(outState, outPersistentState);
      }
  
      @Override
      protected void onRestoreInstanceState(Bundle savedInstanceState) {
          super.onRestoreInstanceState(savedInstanceState);
      }
  }
  </code></pre>
  
  <p>Implementing  <code>onPostResume()</code> by skipping below methods doesn't serve the purpose?</p>
  
  <pre><code>onRestart(), onStart(), onResume()
  </code></pre>
  
  <p>What are the advantages of implementing these three methods if I implement <code>onPostResume()</code> ?</p>
  
  <pre><code>onRestart(), onStart(), onResume()
  </code></pre>