# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Methods | Inherited Methods

# FragmentController

`public class FragmentController`
`extends Object` ``

java.lang.Object
↳ | android.app.FragmentController

This class is deprecated.
Use the Support Library `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 methods
`void` | `attachHost(Fragment parent)` Attaches the host to the FragmentManager for this controller.
`static final FragmentController` | `createController(FragmentHostCallback<?> callbacks)` Returns a `FragmentController`.
`void` | `dispatchActivityCreated()` Moves all Fragments managed by the controller's FragmentManager into the activity created state.
`void` | `dispatchConfigurationChanged(Configuration newConfig)` Lets all Fragments managed by the controller's FragmentManager know a configuration change occurred.
`boolean` | `dispatchContextItemSelected(MenuItem item)` Sends a context item selection event to the Fragments managed by the controller's FragmentManager.
`void` | `dispatchCreate()` Moves all Fragments managed by the controller's FragmentManager into the create state.
`boolean` | `dispatchCreateOptionsMenu(Menu menu, MenuInflater inflater)` Lets all Fragments managed by the controller's FragmentManager know they should create an options menu.
`void` | `dispatchDestroy()` Moves all Fragments managed by the controller's FragmentManager into the destroy state.
`void` | `dispatchDestroyView()` Moves all Fragments managed by the controller's FragmentManager into the destroy view state.
`void` | `dispatchLowMemory()` Lets all Fragments managed by the controller's FragmentManager know the device is in a low memory condition.
`void` | `dispatchMultiWindowModeChanged(boolean isInMultiWindowMode)` This method is deprecated. use `dispatchMultiWindowModeChanged(boolean, android.content.res.Configuration)`
`void` | `dispatchMultiWindowModeChanged(boolean isInMultiWindowMode, Configuration newConfig)` Lets all Fragments managed by the controller's FragmentManager know the multi-window mode of the activity changed.
`boolean` | `dispatchOptionsItemSelected(MenuItem item)` Sends an option item selection event to the Fragments managed by the controller's FragmentManager.
`void` | `dispatchOptionsMenuClosed(Menu menu)` Lets all Fragments managed by the controller's FragmentManager know their options menu has closed.
`void` | `dispatchPause()` Moves all Fragments managed by the controller's FragmentManager into the pause state.
`void` | `dispatchPictureInPictureModeChanged(boolean isInPictureInPictureMode, Configuration newConfig)` Lets all Fragments managed by the controller's FragmentManager know the picture-in-picture mode of the activity changed.
`void` | `dispatchPictureInPictureModeChanged(boolean isInPictureInPictureMode)` This method is deprecated. use `dispatchPictureInPictureModeChanged(boolean, android.content.res.Configuration)`
`boolean` | `dispatchPrepareOptionsMenu(Menu menu)` Lets all Fragments managed by the controller's FragmentManager know they should prepare their options menu for display.
`void` | `dispatchResume()` Moves all Fragments managed by the controller's FragmentManager into the resume state.
`void` | `dispatchStart()` Moves all Fragments managed by the controller's FragmentManager into the start state.
`void` | `dispatchStop()` Moves all Fragments managed by the controller's FragmentManager into the stop state.
`void` | `dispatchTrimMemory(int level)` Lets all Fragments managed by the controller's FragmentManager know they should trim their memory usage.
`void` | `doLoaderDestroy()` Destroys the loaders and, if their state is not being retained, removes them.
`void` | `doLoaderStart()` Starts the loaders.
`void` | `doLoaderStop(boolean retain)` Stops the loaders, optionally retaining their state.
`void` | `dumpLoaders(String prefix, FileDescriptor fd, PrintWriter writer, String[] args)` Dumps the current state of the loaders.
`boolean` | `execPendingActions()` Execute any pending actions for the Fragments managed by the controller's FragmentManager.
`Fragment` | `findFragmentByWho(String who)` Returns a fragment with the given identifier.
`FragmentManager` | `getFragmentManager()` Returns a `FragmentManager` for this controller.
`LoaderManager` | `getLoaderManager()` Returns a `LoaderManager`.
`void` | `noteStateNotSaved()` Marks the fragment state as unsaved.
`View` | `onCreateView(View parent, String name, Context context, AttributeSet attrs)` Instantiates a Fragment's view.
`void` | `reportLoaderStart()` Lets the loaders know the host is ready to receive notifications.
`void` | `restoreAllState(Parcelable state, FragmentManagerNonConfig nonConfig)` Restores the saved state for all Fragments.
`void` | `restoreAllState(Parcelable state, List<Fragment> nonConfigList)` This method is deprecated. use `restoreAllState(android.os.Parcelable, android.app.FragmentManagerNonConfig)`
`void` | `restoreLoaderNonConfig(ArrayMap<String, LoaderManager> loaderManagers)` Restores the saved state for all LoaderManagers.
`ArrayMap<String, LoaderManager>` | `retainLoaderNonConfig()` Returns a list of LoaderManagers that have opted to retain their instance across configuration changes.
`FragmentManagerNonConfig` | `retainNestedNonConfig()` Returns a nested tree of Fragments that have opted to retain their instance across configuration changes.
`List<Fragment>` | `retainNonConfig()` This method is deprecated. use `retainNestedNonConfig()` to also track retained nested child fragments
`Parcelable` | `saveAllState()` Saves the state for all Fragments.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public methods

### attachHost

    public void attachHost (Fragment parent)

Attaches the host to the FragmentManager for this controller. The host must be attached before the FragmentManager can be used to manage Fragments.

Parameters
`parent` | `Fragment`

### createController

    public static final FragmentController createController (FragmentHostCallback<?> callbacks)

Returns a `FragmentController`.

Parameters
`callbacks` | `FragmentHostCallback`

Returns
`FragmentController` |

### dispatchActivityCreated

    public void dispatchActivityCreated ()

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

Call when Fragments should be informed their host has been created.

See also:

- `Fragment.onActivityCreated(Bundle)`

### dispatchConfigurationChanged

    public void dispatchConfigurationChanged (Configuration newConfig)

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

Call when there is a configuration change.

Parameters
`newConfig` | `Configuration`

See also:

- `Fragment.onConfigurationChanged(Configuration)`

### dispatchContextItemSelected

    public boolean dispatchContextItemSelected (MenuItem item)

Sends a context item selection event to the Fragments managed by the controller's FragmentManager. Once the event has been consumed, no additional handling will be performed.

Call immediately after an options menu item has been selected

Parameters
`item` | `MenuItem`

Returns
`boolean` | `true` if the context menu selection event was consumed

See also:

- `Fragment.onContextItemSelected(MenuItem)`

### dispatchCreate

    public void dispatchCreate ()

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

Call when Fragments should be created.

See also:

- `Fragment.onCreate(Bundle)`

### dispatchCreateOptionsMenu

    public boolean dispatchCreateOptionsMenu (Menu menu,
                    MenuInflater inflater)

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

Call when the Fragment should create an options menu.

Parameters
`menu` | `Menu`
`inflater` | `MenuInflater`

Returns
`boolean` | `true` if the options menu contains items to display

See also:

- `Fragment.onCreateOptionsMenu(Menu, MenuInflater)`

### dispatchDestroy

    public void dispatchDestroy ()

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

Call when Fragments should be destroyed.

See also:

- `Fragment.onDestroy()`

### dispatchDestroyView

    public void dispatchDestroyView ()

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

Call when the Fragment's views should be destroyed.

See also:

- `Fragment.onDestroyView()`

### dispatchLowMemory

    public void dispatchLowMemory ()

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

Call when the device is low on memory and Fragment's should trim their memory usage.

See also:

- `Fragment.onLowMemory()`

### dispatchMultiWindowModeChanged

    public void dispatchMultiWindowModeChanged (boolean isInMultiWindowMode)

This method is deprecated.
use `dispatchMultiWindowModeChanged(boolean, android.content.res.Configuration)`

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

Call when the multi-window mode of the activity changed.

Parameters
`isInMultiWindowMode` | `boolean`

See also:

- `Fragment.onMultiWindowModeChanged(boolean)`

### dispatchMultiWindowModeChanged

    public void dispatchMultiWindowModeChanged (boolean isInMultiWindowMode,
                    Configuration newConfig)

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

Call when the multi-window mode of the activity changed.

Parameters
`isInMultiWindowMode` | `boolean`
`newConfig` | `Configuration`

See also:

- `Fragment.onMultiWindowModeChanged(boolean)`

### dispatchOptionsItemSelected

    public boolean dispatchOptionsItemSelected (MenuItem item)

Sends an option item selection event to the Fragments managed by the controller's FragmentManager. Once the event has been consumed, no additional handling will be performed.

Call immediately after an options menu item has been selected

Parameters
`item` | `MenuItem`

Returns
`boolean` | `true` if the options menu selection event was consumed

See also:

- `Fragment.onOptionsItemSelected(MenuItem)`

### dispatchOptionsMenuClosed

    public void dispatchOptionsMenuClosed (Menu menu)

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

Call immediately after closing the Fragment's options menu.

Parameters
`menu` | `Menu`

See also:

- `Fragment.onOptionsMenuClosed(Menu)`

### dispatchPause

    public void dispatchPause ()

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

Call when Fragments should be paused.

See also:

- `Fragment.onPause()`

### dispatchPictureInPictureModeChanged

    public void dispatchPictureInPictureModeChanged (boolean isInPictureInPictureMode,
                    Configuration newConfig)

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

Call when the picture-in-picture mode of the activity changed.

Parameters
`isInPictureInPictureMode` | `boolean`
`newConfig` | `Configuration`

See also:

- `Fragment.onPictureInPictureModeChanged(boolean)`

### dispatchPictureInPictureModeChanged

    public void dispatchPictureInPictureModeChanged (boolean isInPictureInPictureMode)

This method is deprecated.
use `dispatchPictureInPictureModeChanged(boolean, android.content.res.Configuration)`

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

Call when the picture-in-picture mode of the activity changed.

Parameters
`isInPictureInPictureMode` | `boolean`

See also:

- `Fragment.onPictureInPictureModeChanged(boolean)`

### dispatchPrepareOptionsMenu

    public boolean dispatchPrepareOptionsMenu (Menu menu)

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

Call immediately before displaying the Fragment's options menu.

Parameters
`menu` | `Menu`

Returns
`boolean` | `true` if the options menu contains items to display

See also:

- `Fragment.onPrepareOptionsMenu(Menu)`

### dispatchResume

    public void dispatchResume ()

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

Call when Fragments should be resumed.

See also:

- `Fragment.onResume()`

### dispatchStart

    public void dispatchStart ()

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

Call when Fragments should be started.

See also:

- `Fragment.onStart()`

### dispatchStop

    public void dispatchStop ()

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

Call when Fragments should be stopped.

See also:

- `Fragment.onStop()`

### dispatchTrimMemory

    public void dispatchTrimMemory (int level)

Lets all Fragments managed by the controller's FragmentManager know they should trim their memory usage.

Call when the Fragment can release allocated memory [such as if the Fragment is in the background].

Parameters
`level` | `int`

See also:

- `Fragment.onTrimMemory(int)`

### doLoaderDestroy

    public void doLoaderDestroy ()

Destroys the loaders and, if their state is not being retained, removes them.

### doLoaderStart

    public void doLoaderStart ()

Starts the loaders.

### doLoaderStop

    public void doLoaderStop (boolean retain)

Stops the loaders, optionally retaining their state. This is useful for keeping the loader state across configuration changes.

Parameters
`retain` | `boolean`: When `true`, the loaders aren't stopped, but, their instances are retained in a started state

### dumpLoaders

    public void dumpLoaders (String prefix,
                    FileDescriptor fd,
                    PrintWriter writer,
                    String[] args)

Dumps the current state of the loaders.

Parameters
`prefix` | `String`
`fd` | `FileDescriptor`
`writer` | `PrintWriter`
`args` | `String`

### execPendingActions

    public boolean execPendingActions ()

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

Call when queued actions can be performed [eg when the Fragment moves into a start or resume state].

Returns
`boolean` | `true` if queued actions were performed

### findFragmentByWho

    public Fragment findFragmentByWho (String who)

Returns a fragment with the given identifier.

Parameters
`who` | `String`

Returns
`Fragment` | This value may be `null`.

### getFragmentManager

    public FragmentManager getFragmentManager ()

Returns a `FragmentManager` for this controller.

Returns
`FragmentManager` |

### getLoaderManager

    public LoaderManager getLoaderManager ()

Returns a `LoaderManager`.

Returns
`LoaderManager` |

### noteStateNotSaved

    public void noteStateNotSaved ()

Marks the fragment state as unsaved. This allows for "state loss" detection.

### onCreateView

    public View onCreateView (View parent,
                    String name,
                    Context context,
                    AttributeSet attrs)

Instantiates a Fragment's view.

Parameters
`parent` | `View`: The parent that the created view will be placed in; note that this may be null.
`name` | `String`: Tag name to be inflated.
`context` | `Context`: The context the view is being created in.
`attrs` | `AttributeSet`: Inflation attributes as specified in XML file.

Returns
`View` | view the newly created view

### reportLoaderStart

    public void reportLoaderStart ()

Lets the loaders know the host is ready to receive notifications.

### restoreAllState

    public void restoreAllState (Parcelable state,
                    FragmentManagerNonConfig nonConfig)

Restores the saved state for all Fragments. The given FragmentManagerNonConfig are Fragment instances retained across configuration changes, including nested fragments

Parameters
`state` | `Parcelable`
`nonConfig` | `FragmentManagerNonConfig`

See also:

- `retainNestedNonConfig()`

### restoreAllState

    public void restoreAllState (Parcelable state,
                    List<Fragment> nonConfigList)

This method is deprecated.
use `restoreAllState(android.os.Parcelable, android.app.FragmentManagerNonConfig)`

Restores the saved state for all Fragments. The given Fragment list are Fragment instances retained across configuration changes.

Parameters
`state` | `Parcelable`
`nonConfigList` | `List`

See also:

- `retainNonConfig()`

### restoreLoaderNonConfig

    public void restoreLoaderNonConfig (ArrayMap<String, LoaderManager> loaderManagers)

Restores the saved state for all LoaderManagers. The given LoaderManager list are LoaderManager instances retained across configuration changes.

Parameters
`loaderManagers` | `ArrayMap`

See also:

- `retainLoaderNonConfig()`

### retainLoaderNonConfig

    public ArrayMap<String, LoaderManager> retainLoaderNonConfig ()

Returns a list of LoaderManagers that have opted to retain their instance across configuration changes.

Returns
`ArrayMap<String, LoaderManager>` |

### retainNestedNonConfig

    public FragmentManagerNonConfig retainNestedNonConfig ()

Returns a nested tree of Fragments that have opted to retain their instance across configuration changes.

Returns
`FragmentManagerNonConfig` |

### retainNonConfig

    public List<Fragment> retainNonConfig ()

This method is deprecated.
use `retainNestedNonConfig()` to also track retained nested child fragments

Returns a list of Fragments that have opted to retain their instance across configuration changes.

Returns
`List<Fragment>` |

### saveAllState

    public Parcelable saveAllState ()

Saves the state for all Fragments.

Returns
`Parcelable` |

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*