前言 - context 源码 可以先了解官方 context.go 轮廓. 这里捎带保存一份当前 context 版本备份. // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package context defines
版权声明:本文为博主原创文章,未经博主允许不得转载. 微博:厉圣杰 源码:AndroidDemo/Fragment 文中如有纰漏,欢迎大家留言指出. 之前写过一篇关于 Fragment 生命周期的文章,针对 Fragment 各种情况下的生命周期进行了讨论,这段时间对 Fragment 的使用次数逐渐增加,对 Fragment 也有一定的了解,写此文以做总结.本文中使用 support library v4 包中的 Fragment. 本文大致会从以下几个方面对 Fragment 进行总结,如有
先说结论: 1. 当需要给Fragment传值时,使用newInstance()方式来实例化一个Fragment,能够更好的将该Fragment使用的参数捆绑起来,不必每次实例化时都写下面的代码: Bundle args = new Bundle(); 2. 由于是在工厂方法内部封装了传参的方法,所以传入的参数将会得到保留,即使Fragment旋转重建也能够重新获取到这些传入参数. Android日常研发中不可避免的肯定要用到Fragment,你如何使用的呢?Compare the two me