Thiết kế Website - Software - Game

Sáng tạo không ngừng !

Activity lifecycle trong android

Activity Lifecycle

public class Activity extends ApplicationContext {
     protected void onCreate(Bundle savedInstanceState);

     protected void onStart();

     protected void onRestart();

     protected void onResume();

     protected void onPause();

     protected void onStop();

     protected void onDestroy();

1. Open app the fisrt
onCreate -> onStart -> onResume

2. Recall app
onRestart ->onStart -> onResume

3. Destroy
From app, i goback by keyword back of android, then
onPause -> onStop -> onDestroy

4. Kill app (The same onDestroy all activity like app)
- Kill hot
- When outOffMemory then will be kill

1 Comment

  1. 找了好久才找到这里,来了就不想走!

Leave a Reply

Your email address will not be published.