FragmentController

public class FragmentController


Provides integration points with a FragmentManager for a fragment host.

It is the responsibility of the host to take care of the Fragment's lifecycle. The methods provided by FragmentController are for that purpose.

Summary

Public constructors

Public methods

void

Attaches the host to the FragmentManager for this controller.

static @NonNull FragmentController

Returns a FragmentController.

void

Moves all Fragments managed by the controller's FragmentManager into the activity created state.

void

Lets all Fragments managed by the controller's FragmentManager know a configuration change occurred.

boolean

Sends a context item selection event to the Fragments managed by the controller's FragmentManager.

void

Moves all Fragments managed by the controller's FragmentManager into the create state.

boolean
dispatchCreateOptionsMenu(
    @NonNull Menu menu,
    @NonNull MenuInflater inflater
)

Lets all Fragments managed by the controller's FragmentManager know they should create an options menu.

void

Moves Fragments managed by the controller's FragmentManager into the destroy state.

void

Moves all Fragments managed by the controller's FragmentManager into the destroy view state.

void

Lets all Fragments managed by the controller's FragmentManager know the device is in a low memory condition.

void
dispatchMultiWindowModeChanged(boolean isInMultiWindowMode)

Lets all Fragments managed by the controller's FragmentManager know the multi-window mode of the activity changed.

boolean

Sends an option item selection event to the Fragments managed by the controller's FragmentManager.

void

Lets all Fragments managed by the controller's FragmentManager know their options menu has closed.

void

Moves all Fragments managed by the controller's FragmentManager into the pause state.

void
dispatchPictureInPictureModeChanged(boolean isInPictureInPictureMode)

Lets all Fragments managed by the controller's FragmentManager know the picture-in-picture mode of the activity changed.

boolean

Lets all Fragments managed by the controller's FragmentManager know they should prepare their options menu for display.

void

This method is deprecated.

This functionality has been rolled into dispatchStop.

void

Moves all Fragments managed by the controller's FragmentManager into the resume state.

void

Moves all Fragments managed by the controller's FragmentManager into the start state.

void

Moves all Fragments managed by the controller's FragmentManager into the stop state.

void

This method is deprecated.

Loaders are managed separately from FragmentController

void

This method is deprecated.

Loaders are managed separately from FragmentController

void

This method is deprecated.

Loaders are managed separately from FragmentController

void
doLoaderStop(boolean retain)

This method is deprecated.

Loaders are managed separately from FragmentController

void
dumpLoaders(
    @NonNull String prefix,
    @Nullable FileDescriptor fd,
    @NonNull PrintWriter writer,
    String[] args
)

This method is deprecated.

Loaders are managed separately from FragmentController

boolean

Execute any pending actions for the Fragments managed by the controller's FragmentManager.

@Nullable Fragment

Returns a fragment with the given identifier.

@NonNull List<Fragment>

Returns the list of active fragments.

int

Returns the number of active fragments.

@NonNull FragmentManager

Returns a FragmentManager for this controller.

LoaderManager

This method is deprecated.

Loaders are managed separately from FragmentController and this now throws an UnsupportedOperationException.

void

Marks the fragment state as unsaved.

@Nullable View
onCreateView(
    @Nullable View parent,
    @NonNull String name,
    @NonNull Context context,
    @NonNull AttributeSet attrs
)

Instantiates a Fragment's view.

void

This method is deprecated.

Loaders are managed separately from FragmentController

void
restoreAllState(
    @