Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 3. Managing lifecycle and state > Knowing the Activity lifecycle

3.2. Knowing the Activity lifecycle

Much like processes, activities don’t get to hang around forever and suck up memory and CPU cycles. Even within a process, with multiple activities associated to the same application, some activities will be in the foreground and others won’t. Those in the foreground, the ones the user is working with, get the priority. Other activities may be stopped when the platform needs to reclaim resources (or killed if the process hosting them is itself killed, based on the hierarchy we discussed in the previous section).

Users aren’t supposed to notice any of the process and activity swapping that the platform does. To them the entire workflow of any task they want to perform should be seamless. If some activities are created new, and some are restored from an inactive state, the user doesn’t care and shouldn’t notice.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial