Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b00e3e37 authored by Clara Bayarri's avatar Clara Bayarri Committed by Android (Google) Code Review
Browse files

Merge "Improve Exception message for adding private fragments"

parents 2031d698 eb7b7ecd
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -473,8 +473,9 @@ final class BackStackRecord extends FragmentTransaction implements
            if (targetSdkVersion > Build.VERSION_CODES.N && (fragmentClass.isAnonymousClass()
                    || !Modifier.isPublic(modifiers)
                    || (fragmentClass.isMemberClass() && !Modifier.isStatic(modifiers)))) {
                throw new IllegalStateException("Fragment must be a public static class to be "
                        + "properly recreated on configuration change.");
                throw new IllegalStateException("Fragment " + fragmentClass.getCanonicalName()
                        + " must be a public static class to be  properly recreated from"
                        + " instance state.");
            }
        }
        fragment.mFragmentManager = mManager;