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

The following examples show how to use android.app.fragmentmanager#isStateSaved() . 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 File: RationaleDialogFragment.java    From BaseProject with 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
Source File: RationaleDialogFragment.java    From easypermissions with Apache License 2.0 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);
}