Open main menu

CDOT Wiki β

Changes

MAP524/DPS924 Lecture 3

784 bytes added, 12:02, 12 July 2015
Activity
== Activity ==
 
An actifity is kind of like a screen, and kind of like an application, but is actually something in between. Every application with a user interface needs at least one activity that will display the layout for one screen.
 
Then an application may choose to start more activities. The following diagram is the reason for many, many crashes of apps on the Android Market because it's so complicated:
 
[[Image:android_activity_lifecycle.png]]
 
Because Android tries to save as much battery power as possible - it puts applications to sleep all the time, and sometimes even kills them alltogether.
 
Making sure that your user experience is still nice despite that you need to navigate the diagram above to figure out when to load, unload, save, reload both data and the state of the UI.