Android Development

Activity Life Cycle

In the event that you have worked with C, C++ or Java programming language you more likely than not seen that your program begins from main() work. Fundamentally the same as way, Android framework starts its program inside an Activity beginning with an approach onCreate() callback method. There is a sequence of callback methods that fire up an action and an arrangement of callback strategies. That destroy an action as demonstrated in the beneath Activity lifecycle diagram.

CallbackDescription
onCreate()  When the activity is first created this is the first call back 
onStart() This callback is called when the activity becomes visible to the user
onPause() This paused activity does not receive user input and cannot execute any code and it will pause the application activities until change the status
onResume() This is called when the user starts interacting with the application
onStop() This callback is called when the activity no longer needs to be visible
onDestroy() This callback is called before the activity is destroyed by the system
onRestart() This callback is used when the activity restarts after stopping it
Activity Stack (Prev Lesson)
(Next Lesson) UI Layouts
Back to Android Development

No Comments

Give a comment