Loading core/java/android/app/BackStackRecord.java +4 −0 Original line number Diff line number Diff line Loading @@ -470,6 +470,10 @@ final class BackStackRecord extends FragmentTransaction implements } if (containerViewId != 0) { if (containerViewId == View.NO_ID) { throw new IllegalArgumentException("Can't add fragment " + fragment + " with tag " + tag + " to container view with no id"); } if (fragment.mFragmentId != 0 && fragment.mFragmentId != containerViewId) { throw new IllegalStateException("Can't change container ID of fragment " + fragment + ": was " + fragment.mFragmentId Loading core/java/android/app/FragmentManager.java +15 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.animation.PropertyValuesHolder; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources.NotFoundException; import android.content.res.TypedArray; import android.os.Bundle; import android.os.Debug; Loading Loading @@ -960,12 +961,24 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate if (!f.mFromLayout) { ViewGroup container = null; if (f.mContainerId != 0) { if (f.mContainerId == View.NO_ID) { throwException(new IllegalArgumentException( "Cannot create fragment " + f + " for a container view with no id")); } container = (ViewGroup) mContainer.onFindViewById(f.mContainerId); if (container == null && !f.mRestored) { String resName; try { resName = f.getResources().getResourceName(f.mContainerId); } catch (NotFoundException e) { resName = "unknown"; } throwException(new IllegalArgumentException( "No view found for id 0x" + Integer.toHexString(f.mContainerId) + " (" + f.getResources().getResourceName(f.mContainerId) + resName + ") for fragment " + f)); } } Loading Loading
core/java/android/app/BackStackRecord.java +4 −0 Original line number Diff line number Diff line Loading @@ -470,6 +470,10 @@ final class BackStackRecord extends FragmentTransaction implements } if (containerViewId != 0) { if (containerViewId == View.NO_ID) { throw new IllegalArgumentException("Can't add fragment " + fragment + " with tag " + tag + " to container view with no id"); } if (fragment.mFragmentId != 0 && fragment.mFragmentId != containerViewId) { throw new IllegalStateException("Can't change container ID of fragment " + fragment + ": was " + fragment.mFragmentId Loading
core/java/android/app/FragmentManager.java +15 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.animation.PropertyValuesHolder; import android.animation.ValueAnimator; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources.NotFoundException; import android.content.res.TypedArray; import android.os.Bundle; import android.os.Debug; Loading Loading @@ -960,12 +961,24 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate if (!f.mFromLayout) { ViewGroup container = null; if (f.mContainerId != 0) { if (f.mContainerId == View.NO_ID) { throwException(new IllegalArgumentException( "Cannot create fragment " + f + " for a container view with no id")); } container = (ViewGroup) mContainer.onFindViewById(f.mContainerId); if (container == null && !f.mRestored) { String resName; try { resName = f.getResources().getResourceName(f.mContainerId); } catch (NotFoundException e) { resName = "unknown"; } throwException(new IllegalArgumentException( "No view found for id 0x" + Integer.toHexString(f.mContainerId) + " (" + f.getResources().getResourceName(f.mContainerId) + resName + ") for fragment " + f)); } } Loading