Chapter 1
Android Activities
In This Chapter
Launching an activity
Going through an activity’s lifecycle
Getting information from an activity
On a desktop computer, everything starts with a window. Open a window, and run a word processor. Open another window, and read your email. Move a window, minimize a window, resize a window. It’s a very familiar story.
But mobile devices aren’t desktop computers. A smartphone has a relatively small screen, and if by chance you could open several windows at once, the phone’s processor would fall over from exhaustion. On a mobile phone, the “window” metaphor would lead to nothing but trouble.
Tablet devices have larger screens and better processors than their telephone cousins. You can probably squeeze a few windows on a tablet screen, but the power that you would allocate to window-handling could be put to better use.
So where does that leave you? The earliest computers had no windows and no multitasking. You can’t have that. Without some kind of multitasking, “smartphones” wouldn’t be smart.
Android’s first and foremost answer to all windowing questions is the activity. In other chapters, I refer to an activity as “one screenful of components.” ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access