How to save states of Views in Fragments on TabChange
来源:互联网 发布:邮件收发软件 编辑:程序博客网 时间:2024/05/21 17:57
@Overridepublic void onTabChanged(String tabId) {TabInfo newTab = mTabs.get(tabId);if (mLastTab != newTab) {FragmentTransaction ft = mActivity.getSupportFragmentManager().beginTransaction();if (mLastTab != null) {if (mLastTab.fragment != null) {//ft.detach(mLastTab.fragment);ft.hide(mLastTab.fragment);}}if (newTab != null) {if (newTab.fragment == null) {newTab.fragment = Fragment.instantiate(mActivity, newTab.clss.getName(), newTab.args);ft.add(mContainerId, newTab.fragment, newTab.tag);} else {//ft.attach(newTab.fragment);ft.show(newTab.fragment);}}mLastTab = newTab;ft.commit();mActivity.getSupportFragmentManager().executePendingTransactions();}}}
0 0
- How to save states of Views in Fragments on TabChange
- How to prevent resizing of views in a splitter window
- How to: Change color of rows in GridView on mouseover
- How to: Filter List Views on the UI Specific Level
- how to save array in file in c#
- How to save cookie in file for Requests
- QT14 how to save data in sqlite database with pushbutton
- How to:Save Layout
- In Android how to display one view as overlay on top of another view?
- How to save content/text of a web page by forcing save-as option
- two ways to hold the states of a job in ironic
- How to save data in ASCII format in ADS for use in MATLAB
- save views
- How to save brightness settings?
- How to Save a Screenshot
- How to Save a Screenshot
- How to show/hide a control in the Column's DataItemTemplate based on the value of another control
- How to find PID of process listening on a port in Linux? netstat and lsof command examples
- 两个linux主机间复制文件
- Linux下生成patch和打patch
- JS短路原理的应用 精简代码的途径
- Oracle学习笔记整理之游标篇
- UISegmentedControl的详细使用
- How to save states of Views in Fragments on TabChange
- Android AIDL简介
- cocos2dx xml
- hive桶(bucket)简介
- linux/unix IP别名
- MyEclipse 基于 jax-ws 的 webService 创建详细步骤(有图)
- 查看java程序内存使用情况相关命令
- 编写Android.mk中的LOCAL_SRC_FILES的终极技巧
- 分支限界算法