Activity
在 Android 平台上,Activity 是应用的基本构建块之一。它们充当用户与应用互动的入口点,同时也决定了用户在应用内部或应用之间导航的方式,前者如返回按钮,后者如“最近使用的应用”按钮。
巧妙地管理 Activity 可以带来很多优势,例如:
- 屏幕方向变化很流畅,不会破坏用户体验。
- 用户数据不会在 Activity 转换过程中丢失。
- 系统可在适当的情况下终止进程。
本部分首先介绍 Activity 的概念,然后详细说明 Activity 生命周期,接着再讨论状态变化及其适应方式。之后,本部分将介绍 Activity 与应用内和应用间导航之间的关系。最后再阐述 Activity 与托管它们的进程之间的关系。
文档
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2020-06-23 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]