Android Activity |Android App Development With AndroidCource

Thursday 14 September 2017

Android Activity

What is Activity ?

An activity represents a single screen with a user interface just like window or frame of Java.The help of activity, you can place all your UI components or widgets in a single screen.


Activity LifeCycle


To navigate transitions between stages of the activity lifecycle, the Activity class provides a core set of seven callbacks: onCreate(), onStart(), onResume(), onPause(), onStop(),onRestart() and onDestroy(). The system invokes each of these callbacks as an activity enters a new state.


List out Activity  Lifecycle methods


onCreate()

This is the first callback and called when the activity is first created.

onStart()

This callback is called when the activity becomes visible to the user.

onResume()

This is called when the user starts interacting with the application.

onPause()

This callback is called when activity is not visible to the user.

onStop()

This callback is called when the activity is no longer visible.

onRestart()

This callback is called when the activity restarts after stopping it.

onDestroy()

This callback is called before the activity is destroyed by the system.





0 comments:

Post a Comment