Android Activity Lifecycle
What is the Android Lifecycle? The Android Activity Lifecycle defines how an activity behaves in different states: - Created - Started - Resumed - Paused - Stopped - Destroyed Lifecycle Methods • onCreate(): Initialize your activity • onStart(): Activity is about to become visible • onResume(): Activity has become visible • onPause(): Partially obscured • onStop(): Fully obscured • onRestart(): Restarting after stop • onDestroy(): Cleanup before destruction JAVA CODE @Override protected void onCreate(Bundle savedInstanceState) { super .onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.d( "lifecycle" , "onCreate invoked" ); } @Ove...