管理Activity的生命周期
来源:互联网 发布:疯狂java讲义精粹 pdf 编辑:程序博客网 时间:2024/04/30 10:16
Managing the Activity Lifecycle
Dependencies and prerequisites
- How to create an Android project (see Creating an Android Project)
You should also read
- Activities
Try it out
ActivityLifecycle.zip
As a user navigates through, out of, and back to your app, the Activity
instances in your app transition between different states in their lifecycle. For instance, when your activity starts for the first time, it comes to the foreground of the system and receives user focus. During this process, the Android system calls a series of lifecycle methods on the activity in which you set up the user interface and other components. If the user performs an action that starts another activity or switches to another app, the system calls another set of lifecycle methods on your activity as it moves into the background (where the activity is no longer visible, but the instance and its state remains intact).
Within the lifecycle callback methods, you can declare how your activity behaves when the user leaves and re-enters the activity. For example, if you're building a streaming video player, you might pause the video and terminate the network connection when the user switches to another app. When the user returns, you can reconnect to the network and allow the user to resume the video from the same spot.
This class explains important lifecycle callback methods that each Activity
instance receives and how you can use them so your activity does what the user expects and does not consume system resources when your activity doesn't need them.
Lessons
- Starting an Activity
- Learn the basics about the activity lifecycle, how the user can launch your app, and how to perform basic activity creation.
- Pausing and Resuming an Activity
- Learn what happens when your activity is paused (partially obscured) and resumed and what you should do during these state changes.
- Stopping and Restarting an Activity
- Learn what happens when the user completely leaves your activity and returns to it.
- Recreating an Activity
- Learn what happens when your activity is destroyed and how you can rebuild the activity state when necessary.
- 管理Activity的生命周期
- 管理Activity的生命周期
- Activity的生命周期管理
- 管理Activity的生命周期
- 管理Activity的生命周期
- 管理activity的生命周期
- activity的生命周期管理。
- 管理Activity的生命周期
- 管理Activity的生命周期
- 4.0 Activity的生命周期管理
- 关于Activity生命周期的管理
- Training--管理activity的生命周期
- 管理Activity的生命周期(1)
- Android Activity---管理Activity的生命周期
- Android Activity---管理Activity的生命周期
- Android Training - Activity生命周期的管理
- 【Android开发】管理Activity的生命周期(1)
- Activity生命周期的管理(序)
- 【SPOJ-GSHOP】Rama and Friends【贪心】【细节】
- Lua_第3 章 表达式
- javascript入门实例三
- POJ 1056 IMMEDIATE DECODABILITY
- 算法C++ 判断出栈顺序是否正确
- 管理Activity的生命周期
- 初识SVN
- centos5.6 中文乱码 问题
- c++ 顺序容器
- 1018. Public Bike Management (30)
- js中央定时器控制
- Bean生命周期
- Light OJ 1402 Assassin`s Creed (状压DP)
- 21.php命名空间