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 phone.Each activity is given a window in which to draw its user interface.
Activity 是安卓的四大组件之一,一个Activity显示一个屏幕的界面,用户可以对这个界面进行操作,这个界面既可以填充满屏幕,也可以只占屏幕一部分。一个Activity就是一个屏幕页面,一个应用可以有多个Activity.
1 Activity 生命周期
Activity生命周期6个方法: *onCreate(), onStart(), onResume(), onPause(), onStop(), onDestroy() *.
生命周期图:
1.1 onCreate() and onStop()
系统第一创建一个activity, 必须调用onCreate()方法,
public void onCreate(Bundle savedInstanceState)
{
方法接受一个Bundle 的参数,
}