Docsity

Mobile Computing Lecture, Lecture notes of Mobile Computing

Partial preview of the text

Download Mobile Computing Lecture and more Lecture notes Mobile Computing in PDF only on Docsity!

Android Activity lifecycles:

An Activity in android application can take these states: 1.Created โ€“ Activity is created 2.Running โ€“ Activity is visible and interacts with the user 3.Paused -Activity is still visible but partially obscured, instance is running but might be killed by the system.

  1. Stopped โ€“ Activity is not visible; instance is running but might be killed by the system.
  2. Destroyed -Activity has been terminated by the system of by a call to its finish() method. When an activity is first created its onCreate() method gets called then if the subsequent onStart() method gets called and then the activity proceeds to its onResume() method it here where the activity starts to run , now another activity can come into foreground which forces this app to go into a paused state , now either this activity can get killed by the os or get resumed or the activity calls its onStop() method where the activity now goes into its Ondestroy() method and get killed.