Descendant navigation is navigation down the application's information hierarchy. This is described inDesigning Effective Navigation and also covered in
Android Design: Application Structure.
Descendant navigation is usually implemented using Intent
objects andstartActivity()
, or by adding fragments to an activity usingFragmentTransaction
objects.http://blog.csdn.net/sergeycao
Implement Master/Detail Flows Across Handsets and Tablets
In a master/detail navigation flow, a master screen contains a list of items in a collection, and adetail screen shows detailed information about a specific item within that collection. Implementing navigation from the master screen
to the detail screen is one form of descendant navigation.
Handset touchscreens are most suitable for displaying one screen at a time (either the master or the detail screen); this concern is further discussed inPlanning for Multiple Touchscreen Sizes. Descendant navigation in this case is often implemented
using anIntent
that starts an activity representing the detail screen. On the other hand, tablet displays, especially when viewed in the landscape orientation, are best suited for showing multiple content panes at a time: the master
on the left, and the detail to the right). Here, descendant navigation is usually implemented using aFragmentTransaction
that adds, removes, or replaces the detail pane with new content.
The basics of implementing this pattern are described in the Implementing Adaptive UI Flows lesson of theDesigning for Multiple Screens class. The class describes how to implement a master/detail flow using two activities on a handset
and a single activity on a tablet.
Navigate into External Activities
There are cases where descending into your application's information hierarchy leads to activities from other applications. For example, when viewing the contact details screen for an entry in the phone address book, a child screen detailing recent posts
by the contact on a social network may belong to a social networking application.
When launching another application's activity to allow the user to say, compose an email or pick a photo attachment, you generally don't want the user to return to this activity if they relaunch your application from the Launcher (the device home screen).
It would be confusing if touching your application icon brought the user to a "compose email" screen.
To prevent this from occurring, simply add the FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
flag to the intent used to launch the external activity, like so:
Intent externalActivityIntent = new Intent(Intent.ACTION_PICK);
externalActivityIntent.setType("image/*");
externalActivityIntent.addFlags(
Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(externalActivityIntent);
分享到:
相关推荐
Android Develops Training 部分, Best Practices for Interaction and Engagement -> Implementing Descendant Navigation章节的demo
Implementing QuantLib
Implementing data cube efficiently
《Implementing CIFS》这本书的完整版,英文的,pdf版
Implementing Qlik Sense 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
Implementing Modern DevOps 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
实现函数式编程语言语法分析器的书implementing functional languages
Implementing Cisco UCS Solutions
With Implementing Domain-Driven Design, Vaughn has made an important contribution not only to the literature of the Domain-Driven Design community, but also to the literature of the broader enterprise...
Title: Implementing Cloud Design Patterns for AWS Author: Marcus Young Length: 234 pages Edition: 1 Language: English Publisher: Packt Publishing Publication Date: 2015-05-15 ISBN-10: 1782177345 ISBN-...
一种使用惰性图归约来理解非严格功能语言的实现的实用方法。
Implementing SAP ERP Sales & Distribution_2008
Implementing Qlik Sense 英文azw3 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
Implementing-Laravel, Companion实现 Laravel的辅助应用 实现 Laravel我的 book的附带应用程序代码实现了 Laravel 。设置请参见文件 public/.htaccess 和 bootstrap/start 。有关自动加载的PSR-0 和应用程序库的app...
CIFS实现参考文档,分PDF和网页两个版本。
Implementing Enterprise Risk Management is a practical guide to establishing an effective ERM system by applying best practices at a granular level. Case studies of leading organizations including ...
高清彩版 Implementing Azure Cloud Design Patterns
Implementing Domain-Driven Design 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
Implementing Domain-Driven Design,比较经典的DDD学习资料,全英文版,爱读原版的应该比较喜欢;
IBM Storwize V3700 Implementing the