fragment(8)根据id查找fragment
来源:互联网 发布:苹果电影下载软件 编辑:程序博客网 时间:2024/05/17 01:49
根据id查找fragment 为什么会返回null ?
如果像下面这样切换frgmt
getFragmentManager().beginTransaction().addToBackStack("LCAF").replace(R.id.container, new LayoutChangedAnimationFrgmt()).commit();
且LayoutChangedAnimationFrgmt对应的layout文件中指定id为 android:id="@+id/fragment_layout_changed_animation"
这时用
getFragmentManager().findFragmentById(R.id.fragment_layout_changed_animation) 会返回null,
用R.id.container可以找到.
LayoutChangedAnimationFrgmt lca = (LayoutChangedAnimationFrgmt) getFragmentManager().findFragmentById(R.id.container);if(lca != null){lca.onOptionsItemSelected(item);}
0 0
- fragment(8)根据id查找fragment
- hibernate根据id查找
- Fragment
- Fragment
- fragment
- Fragment
- Fragment
- Fragment
- Fragment
- fragment
- fragment
- Fragment
- Fragment
- fragment
- Fragment
- Fragment
- Fragment
- Fragment
- HttpServlet注入Spring管理的bean的方法
- reading schema error: null
- 求线段交点
- 转载)爱加密亮相2015广州国际游博会,弘扬安全正能量
- ViewHolder工具类实现
- fragment(8)根据id查找fragment
- 【Android SDK程序逆向分析与破解系列】之三:Android可执行程序DEX分析(二)
- VC中的字符串【转】
- C# - String.Empty vs ""
- JS中判断null、undefined与NaN的方法
- 安卓WIFI原理浅析
- 程序化交易系统总结
- 漫谈高数 特征向量物理意义
- iText中输出中文