FileDocCategorySizeDatePackage
Fragment.javaAPI DocAndroid 5.1 API78204Thu Mar 12 22:22:56 GMT 2015android.support.v4.app

FragmentState

public final class FragmentState extends Object implements android.os.Parcelable

Fields Summary
final String
mClassName
final int
mIndex
final boolean
mFromLayout
final int
mFragmentId
final int
mContainerId
final String
mTag
final boolean
mRetainInstance
final boolean
mDetached
final android.os.Bundle
mArguments
android.os.Bundle
mSavedFragmentState
Fragment
mInstance
public static final Parcelable.Creator
CREATOR
Constructors Summary
public FragmentState(Fragment frag)

        mClassName = frag.getClass().getName();
        mIndex = frag.mIndex;
        mFromLayout = frag.mFromLayout;
        mFragmentId = frag.mFragmentId;
        mContainerId = frag.mContainerId;
        mTag = frag.mTag;
        mRetainInstance = frag.mRetainInstance;
        mDetached = frag.mDetached;
        mArguments = frag.mArguments;
    
public FragmentState(android.os.Parcel in)

        mClassName = in.readString();
        mIndex = in.readInt();
        mFromLayout = in.readInt() != 0;
        mFragmentId = in.readInt();
        mContainerId = in.readInt();
        mTag = in.readString();
        mRetainInstance = in.readInt() != 0;
        mDetached = in.readInt() != 0;
        mArguments = in.readBundle();
        mSavedFragmentState = in.readBundle();
    
Methods Summary
public intdescribeContents()

        return 0;
    
public android.support.v4.app.Fragmentinstantiate(FragmentActivity activity, android.support.v4.app.Fragment parent)

        if (mInstance != null) {
            return mInstance;
        }
        
        if (mArguments != null) {
            mArguments.setClassLoader(activity.getClassLoader());
        }
        
        mInstance = Fragment.instantiate(activity, mClassName, mArguments);
        
        if (mSavedFragmentState != null) {
            mSavedFragmentState.setClassLoader(activity.getClassLoader());
            mInstance.mSavedFragmentState = mSavedFragmentState;
        }
        mInstance.setIndex(mIndex, parent);
        mInstance.mFromLayout = mFromLayout;
        mInstance.mRestored = true;
        mInstance.mFragmentId = mFragmentId;
        mInstance.mContainerId = mContainerId;
        mInstance.mTag = mTag;
        mInstance.mRetainInstance = mRetainInstance;
        mInstance.mDetached = mDetached;
        mInstance.mFragmentManager = activity.mFragments;

        if (FragmentManagerImpl.DEBUG) Log.v(FragmentManagerImpl.TAG,
                "Instantiated fragment " + mInstance);

        return mInstance;
    
public voidwriteToParcel(android.os.Parcel dest, int flags)

        dest.writeString(mClassName);
        dest.writeInt(mIndex);
        dest.writeInt(mFromLayout ? 1 : 0);
        dest.writeInt(mFragmentId);
        dest.writeInt(mContainerId);
        dest.writeString(mTag);
        dest.writeInt(mRetainInstance ? 1 : 0);
        dest.writeInt(mDetached ? 1 : 0);
        dest.writeBundle(mArguments);
        dest.writeBundle(mSavedFragmentState);