本文整理汇总了Java中android.support.v4.app.FragmentTransaction.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java FragmentTransaction.isEmpty方法的具体用法?Java FragmentTransaction.isEmpty怎么用?Java FragmentTransaction.isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.app.FragmentTransaction
的用法示例。
在下文中一共展示了FragmentTransaction.isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onTabReselected
import android.support.v4.app.FragmentTransaction; //导入方法依赖的package包/类
@Override
public void onTabReselected(android.app.ActionBar.Tab tab, android.app.FragmentTransaction ft) {
if (mListener != null) {
FragmentTransaction trans = null;
if (mActivity instanceof FragmentActivity) {
trans = ((FragmentActivity)mActivity).getSupportFragmentManager().beginTransaction()
.disallowAddToBackStack();
}
mListener.onTabReselected(this, trans);
if (trans != null && !trans.isEmpty()) {
trans.commit();
}
}
}
示例2: selectTab
import android.support.v4.app.FragmentTransaction; //导入方法依赖的package包/类
@Override
public void selectTab(Tab tab) {
if (getNavigationMode() != NAVIGATION_MODE_TABS) {
mSavedTabPosition = tab != null ? tab.getPosition() : INVALID_POSITION;
return;
}
FragmentTransaction trans = null;
if (mActivity instanceof FragmentActivity) {
trans = ((FragmentActivity)mActivity).getSupportFragmentManager().beginTransaction()
.disallowAddToBackStack();
}
if (mSelectedTab == tab) {
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabReselected(mSelectedTab, trans);
mTabScrollView.animateToTab(tab.getPosition());
}
} else {
mTabScrollView.setTabSelected(tab != null ? tab.getPosition() : Tab.INVALID_POSITION);
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabUnselected(mSelectedTab, trans);
}
mSelectedTab = (TabImpl) tab;
if (mSelectedTab != null) {
mSelectedTab.getCallback().onTabSelected(mSelectedTab, trans);
}
}
if (trans != null && !trans.isEmpty()) {
trans.commit();
}
}
示例3: selectTab
import android.support.v4.app.FragmentTransaction; //导入方法依赖的package包/类
public void selectTab(Tab tab) {
int i = -1;
if (getNavigationMode() != 2) {
this.mSavedTabPosition = tab != null ? tab.getPosition() : -1;
return;
}
FragmentTransaction trans;
if (!(this.mActivity instanceof FragmentActivity) || this.mDecorToolbar.getViewGroup().isInEditMode()) {
trans = null;
} else {
trans = ((FragmentActivity) this.mActivity).getSupportFragmentManager().beginTransaction().disallowAddToBackStack();
}
if (this.mSelectedTab != tab) {
ScrollingTabContainerView scrollingTabContainerView = this.mTabScrollView;
if (tab != null) {
i = tab.getPosition();
}
scrollingTabContainerView.setTabSelected(i);
if (this.mSelectedTab != null) {
this.mSelectedTab.getCallback().onTabUnselected(this.mSelectedTab, trans);
}
this.mSelectedTab = (TabImpl) tab;
if (this.mSelectedTab != null) {
this.mSelectedTab.getCallback().onTabSelected(this.mSelectedTab, trans);
}
} else if (this.mSelectedTab != null) {
this.mSelectedTab.getCallback().onTabReselected(this.mSelectedTab, trans);
this.mTabScrollView.animateToTab(tab.getPosition());
}
if (trans != null && !trans.isEmpty()) {
trans.commit();
}
}