本文整理了Java中android.support.v4.app.Fragment.isInBackStack()
方法的一些代码示例,展示了Fragment.isInBackStack()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fragment.isInBackStack()
方法的具体详情如下:
包路径:android.support.v4.app.Fragment
类名称:Fragment
方法名:isInBackStack
暂无
代码示例来源:origin: sockeqwe/mosby
/**
* Checks whether or not a given fragment is on the backstack of the fragment manager (could also
* be on top of the backstack and hence visible)
*
* @param fragment The fragment you want to check if its on the back stack
* @return true, if the given Fragment is on the back stack, otherwise false (not on the back
* stack)
*/
public static boolean isFragmentOnBackStack(Fragment fragment) {
try {
return fragment.isInBackStack();
} catch (IllegalAccessError e) {
return isInBackStackAndroidX(fragment);
}
}
代码示例来源:origin: grandcentrix/ThirtyInch
/**
* Checks whether or not a given fragment is on the backstack of the fragment manager (could
* also be on top of the backstack and hence visible)
*
* @param fragment The fragment you want to check if its on the back stack
* @return true, if the given Fragment is on the back stack, otherwise false (not on the back
* stack)
*/
public static boolean isInBackStack(final Fragment fragment) {
try {
return fragment.isInBackStack();
} catch (IllegalAccessError e) {
return isInBackStackAndroidX(fragment);
}
}
代码示例来源:origin: stackoverflow.com
public void removeFragment(Fragment fragment, int transition, int transitionStyle) {
if (DEBUG) Log.v(TAG, "remove: " + fragment + " nesting=" + fragment.mBackStackNesting);
final boolean inactive = !fragment.isInBackStack();
if (!fragment.mDetached || inactive) {
if (mAdded != null) {
mAdded.remove(fragment);
}
if (fragment.mHasMenu && fragment.mMenuVisible) {
mNeedMenuInvalidate = true;
}
fragment.mAdded = false;
fragment.mRemoving = true;
moveToState(fragment, inactive ? Fragment.INITIALIZING : Fragment.CREATED,
transition, transitionStyle, false);
}
}
代码示例来源:origin: com.google.android/support-v4
public void removeFragment(Fragment fragment, int transition, int transitionStyle) {
if (DEBUG) Log.v(TAG, "remove: " + fragment + " nesting=" + fragment.mBackStackNesting);
final boolean inactive = !fragment.isInBackStack();
if (!fragment.mDetached || inactive) {
mAdded.remove(fragment);
if (fragment.mHasMenu && fragment.mMenuVisible) {
mNeedMenuInvalidate = true;
}
fragment.mAdded = false;
fragment.mRemoving = true;
moveToState(fragment, inactive ? Fragment.INITIALIZING : Fragment.CREATED,
transition, transitionStyle);
}
}
代码示例来源:origin: kingargyle/adt-leanback-support
public void removeFragment(Fragment fragment, int transition, int transitionStyle) {
if (DEBUG) Log.v(TAG, "remove: " + fragment + " nesting=" + fragment.mBackStackNesting);
final boolean inactive = !fragment.isInBackStack();
if (!fragment.mDetached || inactive) {
if (mAdded != null) {
mAdded.remove(fragment);
}
if (fragment.mHasMenu && fragment.mMenuVisible) {
mNeedMenuInvalidate = true;
}
fragment.mAdded = false;
fragment.mRemoving = true;
moveToState(fragment, inactive ? Fragment.INITIALIZING : Fragment.CREATED,
transition, transitionStyle, false);
}
}
内容来源于网络,如有侵权,请联系作者删除!