1. Activity是Android 中非常重要的概念. 基本上android 程序就是围绕Activity来进行.
什么是Activity?
"Activity 就是布满整个窗口或者悬浮于其他窗口上的交互界面, 在一个应用程序中, 通常由多个Activity组成." (老罗安卓视频)
An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map. Each activity is given a window in which to draw its user interface. The window typically fills the screen, but may be smaller than the screen and float on top of other windows.
在程序中, activity就是一个java class, 需要继承 android.app.Activity.
里面有几个重要方法, 在下面的生命周期中都有标明.
其中 onCreate()是最重要的, 因为当执行一个activity时, onCreate()方法将会自动被调用.
Activity 生命周期