Bundle is a useful data holder, which maps String values to various Parcelable types. So basically it is a heterogenous key/value map. Bundles are used in Intents, Activities and Fragments for transporting data. I would like to describe how I work…
In MainActivity: getSupportFragmentManager().beginTransaction().replace(R.id.gif_contents, gifPageTwoFragment, "gifPageTwoFragment").addToBackStack("gifPageTwoFragment").commit(); In GifPageTwoFragment: @Override public void onActivity…
干货(1) 首先创建一个抽象类BackHandledFragment,该类有一个抽象方法onBackPressed(),所有BackHandledFragment的子类在onBackPressed方法中处理各自对Back事件的消费逻辑.onBackPressed返回布尔值,宿主FragmentActivity将会根据该方法的返回值判断子Fragment是否有消费Back事件.此外,宿主FragmentActivity还会保持一份当前Fragment的引用,当用户按下Back键时,宿主Activi…
AppBar官方文档摘记 2016-6-12 本文摘自Android官方文档,为方便自己及其他开发者朋友阅读. 章节目录为"Develop > Training > Best Practices for User Interface > Adding the App Bar". Adding the App Bar App Bar是谷歌推荐的为应用带来统一外观和一致导航的UI设计元素,已有的Action Bar就是早先SDK中引入的实现.但Action Bar的引入最…
注:本篇博文转载于 http://my.oschina.net/mengshuai/blog/541314?fromerr=z8tDxWUH 本文介绍了文章作者从事了几年android应用的开发,经历2次架构变革,第一次集成了RxJava第二次集成了MVP,并将RxJava与MVP完美结合,实现了低耦合,代码简单,测试方便的架构. 其实我们在开发中也遇到过,Android入门门槛较低,如果前期对APP规划不清晰,Coder们对未来变化把握不准,技术架构经验不够强大,最终导致就是一个Activit…
EventBus Features What makes greenrobot's EventBus unique, are its features: Simple yet powerful: EventBus is a tiny library with an API that is super easy to learn. Nevertheless, your software architecture may great benefit by decoupling components:…
Adding an Action View An action view is a widget that appears in the action bar as a substitute for an action button. An action view provides fast access to rich actions without changing activities or fragments, and without replacing the action bar.…
原文链接:http://android.eoe.cn/topic/android_sdk Android API 指南 - Android API Guides 应用的组成部分 - Application Components(已经完成已经排版) 应用的基本原理 - Application Fundamentals 活动 - Activities 片段 - Fragments(未完成) 加载器 - Loaders(已完成) 任务和返回堆 - Tasks and Back Stack(已完成已排版…
Action Bar IN THIS DOCUMENT Adding the Action Bar Removing the action bar Using a logo instead of an icon Adding Action Items Handling clicks on action items Using split action bar Navigating Up with the App Icon Adding an Action View Handling collap…
from stack overflow and another chapter I recently grew tired of constantly having to know String keys to pass arguments into Bundles when creating my Fragments. So I decided to make constructors for my Fragments that would take the parameters I want…