Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Take a look on life cycle of Activity <img src="https://i.stack.imgur.com/Jk8de.png" alt="enter image description here"></p> <p>Where </p> <pre><code>***onCreate()*** </code></pre> <p>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().</p> <pre><code>***onStart()*** </code></pre> <p>Called when the activity is becoming visible to the user. Followed by onResume() if the activity comes to the foreground, or onStop() if it becomes hidden.</p> <p>And you can write your simple class to take a look when these methods call</p> <pre><code>public class TestActivity extends Activity { /** Called when the activity is first created. */ private final static String TAG = "TestActivity"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Log.i(TAG, "On Create ....."); } /* (non-Javadoc) * @see android.app.Activity#onDestroy() */ @Override protected void onDestroy() { super.onDestroy(); Log.i(TAG, "On Destroy ....."); } /* (non-Javadoc) * @see android.app.Activity#onPause() */ @Override protected void onPause() { super.onPause(); Log.i(TAG, "On Pause ....."); } /* (non-Javadoc) * @see android.app.Activity#onRestart() */ @Override protected void onRestart() { super.onRestart(); Log.i(TAG, "On Restart ....."); } /* (non-Javadoc) * @see android.app.Activity#onResume() */ @Override protected void onResume() { super.onResume(); Log.i(TAG, "On Resume ....."); } /* (non-Javadoc) * @see android.app.Activity#onStart() */ @Override protected void onStart() { super.onStart(); Log.i(TAG, "On Start ....."); } /* (non-Javadoc) * @see android.app.Activity#onStop() */ @Override protected void onStop() { super.onStop(); Log.i(TAG, "On Stop ....."); } } </code></pre> <p>Hope this will clear your confusion.</p> <p>And take a look <a href="http://developer.android.com/reference/android/app/Activity.html" rel="noreferrer">here</a> for details.</p> <p><strong><em><a href="http://eagle.phys.utk.edu/guidry/android/lifecycleMethods.html" rel="noreferrer">Lifecycle Methods in Details</a> is a very good example and demo application, which is a very good article to understand the life cycle.</em></strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload