摘要: 在正常使用应用的过程中,应用有时会失去焦点,导致 Activity 暂停。例如,当应用在多窗口模式下运行时,仅有一个应用随时具备焦点;系统将暂停所有其他应用。 例如,当半透明 Activity 打开时(比如对话框样式中的 Activity),上一个 Activity 会暂停。 只要 Activity 阅读全文
posted @ 2017-06-15 13:53 YouseiRaws 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 不同于使用 main() 方法启动应用的其他编程范例,Android 系统会通过调用对应于其生命周期中特定阶段的特定回调方法在 Activity 实例中启动代码。有一系列可启动 Activity 的回调方法,以及一系列可分解 Activity 的回调方法。 本课程概述了最重要的生命周期方法,并向您展 阅读全文
posted @ 2017-06-15 12:51 YouseiRaws 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 当用户导航、退出和返回您的应用时,应用中的 Activity 实例将在其生命周期中转换不同状态。 例如,当您的 Activity 初次开始时,它将出现在系统前台并接收用户焦点。 在这个过程中,Android 系统会对 Activity 调用一系列生命周期方法,通过这些方法,您可以设置用户界面和其他组 阅读全文
posted @ 2017-06-15 12:48 YouseiRaws 阅读(165) 评论(0) 推荐(0) 编辑
摘要: While the latest versions of Android often provide great APIs for your app, you should continue to support older versions of Android until more device 阅读全文
posted @ 2017-06-15 10:16 YouseiRaws 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Android categorizes device screens using two general properties: size and density. You should expect that your app will be installed on devices with s 阅读全文
posted @ 2017-06-15 09:53 YouseiRaws 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 在任何情况下,从您的应用代码中提取 UI 字符串并将其存放在外部文件中都是个好办法。Android 在每个 Android 项目中都提供一个资源目录,从而简化了这一过程。 如果您是使用 Android SDK 工具创建的项目(请阅读创建 Android 项目),工具会在项目的顶层创建一个 res/ 阅读全文
posted @ 2017-06-15 09:12 YouseiRaws 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Android devices come in many shapes and sizes all around the world. With a wide range of device types, you have an opportunity to reach a huge audienc 阅读全文
posted @ 2017-06-15 09:06 YouseiRaws 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 完成上一课的学习后,您已构建了一个应用,它可以显示一个 Activity(单一屏幕)并带有一个文本字段和一个按钮。在本课中,您将向 MainActivity 添加一些代码,这些代码可在用户点按 Send 时启动一个新的 Activity 来显示消息。 注:本课假设您使用 Android Studio 阅读全文
posted @ 2017-06-15 08:33 YouseiRaws 阅读(261) 评论(0) 推荐(0) 编辑