Java Code Examples for android.app.FragmentManager#isStateSaved()

The following examples show how to use android.app.FragmentManager#isStateSaved() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: BaseProject   File: RationaleDialogFragment.java    License: MIT License 5 votes vote down vote up
/**
 * Version of {@link #show(FragmentManager, String)} that no-ops when an IllegalStateException
 * would otherwise occur.
 */
public void showAllowingStateLoss(FragmentManager manager, String tag) {
    // API 26 added this convenient method
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
        if (manager.isStateSaved()) {
            return;
        }
    }

    if (mStateSaved) {
        return;
    }

    show(manager, tag);
}
 
Example 2
/**
 * Version of {@link #show(FragmentManager, String)} that no-ops when an IllegalStateException
 * would otherwise occur.
 */
public void showAllowingStateLoss(FragmentManager manager, String tag) {
    // API 26 added this convenient method
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
        if (manager.isStateSaved()) {
            return;
        }
    }

    if (mStateSaved) {
        return;
    }

    show(manager, tag);
}