Create an android app that demonstrates Activity Lifecycle and Instance State.
In this tutorial we will see the working of Activity lifecycle step by step. Activity life cycle consists of 7 methods as below. onCreate() - Invoked when Activity is created. onStart() - Invoked when Activity is becoming visible. onResume() - Invoked when Activity starts Interacting with user. onPause() - Invoked when Activity is invisible to user onStop() - Invoked when activity is no longer visible. onRestart() - Invoked after your activity is stopped, prior to start. onDestroy() - Invoked before Activity is killed. Let's begin coding .... 💻💻 Step 1: After creating Android project, open activity_main.xml file and paste below code as it is. activity_main.xml <?xml version="1.0" encoding="utf-8" ?> <android.support.constraint.ConstraintLayout xmlns:andr...
Comments
Post a Comment