Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. onCreate()
  2. When the android system first creates the activity, it will call onCreate(). Used to initialize the activity, for example, create the user interface.
  3.  
  4. onStart()
  5. When the activity enters the Started state, the system invokes this callback. The onStart() call makes the activity visible to the user, as the app prepares for the activity to enter the foreground and become interactive.
  6.  
  7. onResume()
  8. When the activity enters the Resumed state, it comes to the foreground, and then the system invokes the onResume()callback. This is the state in which the app interacts with the user.
  9.  
  10. onPause()
  11. The system calls this method as the first indication that the user is leaving your activity (though it does not always mean the activity is being destroyed); it indicates that the activity is no longer in the foreground (though it may still be visible if the user is in multi-window mode).
  12.  
  13. onStop()
  14. When your activity is no longer visible to the user, it has entered the Stopped state, and the system invokes theonStop() callback. This may occur, for example, when a newly launched activity covers the entire screen.
  15.  
  16. onRestart()
  17.  
  18. From the Stopped state, the activity either comes back to interact with the user, or the activity is finished running and goes away. If the activity comes back, the system invokes onRestart()
  19.  
  20. onDestroy()
  21. Android system invokes onDestroy() method before the activity is destroyed. Activity is destroyed because of :
  22.  
  23. the activity is finishing (due to the user completely dismissing the activity or due to finish() being called on the activity), or
  24. the system is temporarily destroying the activity due to a configuration change (such as device rotation or multi-window mode)
  25. or a memory issue in the app
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement