Starting an Activity(开始活动)
来源:互联网 发布:快乐大本营自拍软件 编辑:程序博客网 时间:2024/06/08 07:46
Starting an Activity
Unlike other programming paradigms in which apps are launched with amain()
method, theAndroid system initiates code in anActivity
instance by invoking specificcallback methods that correspond to specific stages of itslifecycle. There is a sequence of callback methods that start up an activity and a sequence ofcallback methods that tear down an activity.
其他编程范例是通过调用主函数方法启动的,而安卓系统启动代码却与他们不同:在活动实例中,在不同的生命周期阶段会调用特定的回调方法,它具有一系列的开始和销毁活动的回调方法。
This lesson provides an overview of the most important lifecycle methods and shows you how tohandle the first lifecycle callback that creates a new instance of your activity.
下面概述最重要的生命周期方法,并演示如何运用第一次生命周期的会回调函数创建一个新的活动实例。
Understand the Lifecycle Callbacks
(理解生命周期回调)
During the life of an activity, the system calls a core set of lifecycle methods ina sequence similar to a step pyramid. That is, each stage of theactivity lifecycle is a separate step on the pyramid. As the system creates a new activity instance,each callback method moves the activity state one step toward the top. The top of the pyramid is thepoint at which the activity is running in the foreground and the user can interact with it.
在活动的生命中,系统调用一系列的核心生命周期方法,这些方法的序列类似于金字塔,且活动周期的每个阶段在金字塔上都是独立的。当系统创建一个活动实例时,回调方法被逐级调用,最后活动状态达到金字塔顶端,该活动状态就是前台运行,也用户与之交互的状态。
As the user begins to leave the activity, the system calls other methods that move the activitystate back down the pyramid in order to dismantle the activity. In some cases, the activity willmove only part way down the pyramid and wait (such as when the user switches to another app), fromwhich point the activity can move back to the top (if the user returns to the activity) andresume where the user left off.
当用户开始离开活动时,系统会调用其他方法撤销该活动。在某些例子中,活动将部分的离开金字塔顶端状态并且等待(比如:当用户切换到其他应用程序),活动能够回到顶端状态(如果用户重新返回到该活动)并且恢复到离开时的状态。
- Starting an Activity(开始活动)
- Starting an Activity 开启一个活动
- Starting an Activity
- 05Starting an Activity
- Starting an Activity
- Starting an Activity
- Starting an Activity(Activity生命周期金字塔模型)
- Process of Starting an Activity
- 启动一个Activity - Starting an Activity
- Android Activity生命周期 之starting an activity
- Android training 管理Activity生命周期之启动Activity(Starting an Activity)
- Notifications --- Preserving Navigation when Starting an Activity
- 【Android界面实现】Starting an Activity(Activity生命周期金字塔模型)
- Recreating an Activity 重新创建一个活动
- activity生命周期---starting an activity 特别好 强烈推荐(http://blog.sina.com.cn/s/blog_8191005601019pp5.html)
- Android之Starting an Activity for a Result例子简介
- [Android Training视频系列]2.1 Starting an Activity
- Android之Starting an Activity for a Result例子简介
- 将python3.1+pyqt4打包成exe
- 正则表达式学习笔记
- js函数传参
- Serializable&Iterator
- 开发移动医疗应用必知的10个掘金点
- Starting an Activity(开始活动)
- win7下的PHP+IIS配置,找不到php5isapi.dll的问题,版本5.4.9
- AC/DC电源适配器科普
- Jedis连接池的使用
- Visual Studio error C2001:常量中有换行符(解决办法)
- c++ vector的几个常见操作的用法测试
- 创建物化视图需要的权限
- 修改domnio自动生成doctype
- Linux 常用命令