本文整理匯總了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();
}
}