Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/app/FragmentController#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/FragmentController#inhmethods)

# FragmentController

*** ** * ** ***

` public class FragmentController `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.FragmentController |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 28.**   

Use the [Support Library](https://developer.android.com/tools/extras/support-library) `https://developer.android.com/reference/androidx/fragment/app/FragmentController.html`

Provides integration points with a `https://developer.android.com/reference/android/app/FragmentManager` for a fragment host.

It is the responsibility of the host to take care of the Fragment's lifecycle. The methods provided by `https://developer.android.com/reference/android/app/FragmentController` are for that purpose.

## Summary

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

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### attachHost

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `parent` | `Fragment` <br /> |

### createController

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Returns a `https://developer.android.com/reference/android/app/FragmentController`.

<br />

| Parameters ||
|---|---|
| `callbacks` | `FragmentHostCallback` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/FragmentController` | <br /> |

### dispatchActivityCreated

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onActivityCreated(android.os.Bundle)`

### dispatchConfigurationChanged

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `newConfig` | `Configuration` <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onConfigurationChanged(android.content.res.Configuration)`

### dispatchContextItemSelected

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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

<br />

| Parameters ||
|---|---|
| `item` | `MenuItem` <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the context menu selection event was consumed <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onContextItemSelected(android.view.MenuItem)`

### dispatchCreate

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void dispatchCreate ()
```

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

Call when Fragments should be created.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onCreate(android.os.Bundle)`

### dispatchCreateOptionsMenu

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `menu` | `Menu` <br /> |
| `inflater` | `MenuInflater` <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the options menu contains items to display <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onCreateOptionsMenu(android.view.Menu,%20android.view.MenuInflater)`

### dispatchDestroy

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void dispatchDestroy ()
```

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

Call when Fragments should be destroyed.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onDestroy()`

### dispatchDestroyView

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onDestroyView()`

### dispatchLowMemory

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onLowMemory()`

### dispatchMultiWindowModeChanged

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void dispatchMultiWindowModeChanged (boolean isInMultiWindowMode)
```

<br />

**This method was deprecated in API level 26.**   

use `https://developer.android.com/reference/android/app/FragmentController#dispatchMultiWindowModeChanged(boolean,%20android.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.

<br />

| Parameters ||
|---|---|
| `isInMultiWindowMode` | `boolean` <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onMultiWindowModeChanged(boolean)`

### dispatchMultiWindowModeChanged

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `isInMultiWindowMode` | `boolean` <br /> |
| `newConfig` | `Configuration` <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onMultiWindowModeChanged(boolean)`

### dispatchOptionsItemSelected

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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

<br />

| Parameters ||
|---|---|
| `item` | `MenuItem` <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the options menu selection event was consumed <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onOptionsItemSelected(android.view.MenuItem)`

### dispatchOptionsMenuClosed

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `menu` | `Menu` <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onOptionsMenuClosed(android.view.Menu)`

### dispatchPause

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void dispatchPause ()
```

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

Call when Fragments should be paused.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onPause()`

### dispatchPictureInPictureModeChanged

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `isInPictureInPictureMode` | `boolean` <br /> |
| `newConfig` | `Configuration` <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onPictureInPictureModeChanged(boolean)`

### dispatchPictureInPictureModeChanged

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void dispatchPictureInPictureModeChanged (boolean isInPictureInPictureMode)
```

<br />

**This method was deprecated in API level 26.**   

use `https://developer.android.com/reference/android/app/FragmentController#dispatchPictureInPictureModeChanged(boolean,%20android.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.

<br />

| Parameters ||
|---|---|
| `isInPictureInPictureMode` | `boolean` <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onPictureInPictureModeChanged(boolean)`

### dispatchPrepareOptionsMenu

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `menu` | `Menu` <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the options menu contains items to display <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onPrepareOptionsMenu(android.view.Menu)`

### dispatchResume

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void dispatchResume ()
```

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

Call when Fragments should be resumed.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onResume()`

### dispatchStart

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void dispatchStart ()
```

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

Call when Fragments should be started.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onStart()`

### dispatchStop

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void dispatchStop ()
```

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

Call when Fragments should be stopped.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onStop()`

### dispatchTrimMemory

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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\].

<br />

| Parameters ||
|---|---|
| `level` | `int` <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/Fragment#onTrimMemory(int)`

### doLoaderDestroy

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void doLoaderDestroy ()
```

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

<br />

### doLoaderStart

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void doLoaderStart ()
```

Starts the loaders.

<br />

### doLoaderStop

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void doLoaderStop (boolean retain)
```

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

<br />

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

### dumpLoaders

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Dumps the current state of the loaders.

<br />

| Parameters ||
|---|---|
| `prefix` | `String` <br /> |
| `fd` | `FileDescriptor` <br /> |
| `writer` | `PrintWriter` <br /> |
| `args` | `String` <br /> |

### execPendingActions

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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\].

<br />

| Returns ||
|---|---|
| `boolean` | `true` if queued actions were performed <br /> |

### findFragmentByWho

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Fragment findFragmentByWho (String who)
```

Returns a fragment with the given identifier.

<br />

| Parameters ||
|---|---|
| `who` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Fragment` | This value may be `null`. <br /> |

### getFragmentManager

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public FragmentManager getFragmentManager ()
```

Returns a `https://developer.android.com/reference/android/app/FragmentManager` for this controller.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/FragmentManager` | <br /> |

### getLoaderManager

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public LoaderManager getLoaderManager ()
```

Returns a `https://developer.android.com/reference/android/app/LoaderManager`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/LoaderManager` | <br /> |

### noteStateNotSaved

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void noteStateNotSaved ()
```

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

<br />

### onCreateView

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Instantiates a Fragment's view.

<br />

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

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/View` | view the newly created view <br /> |

### reportLoaderStart

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void reportLoaderStart ()
```

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

<br />

### restoreAllState

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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

<br />

| Parameters ||
|---|---|
| `state` | `Parcelable` <br /> |
| `nonConfig` | `FragmentManagerNonConfig` <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/FragmentController#retainNestedNonConfig()`

### restoreAllState

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

<br />

**This method was deprecated in API level 24.**   

use `https://developer.android.com/reference/android/app/FragmentController#restoreAllState(android.os.Parcelable,%20android.app.FragmentManagerNonConfig)`

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

<br />

| Parameters ||
|---|---|
| `state` | `Parcelable` <br /> |
| `nonConfigList` | `List` <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/FragmentController#retainNonConfig()`

### restoreLoaderNonConfig

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `loaderManagers` | `ArrayMap` <br /> |

**See also:**

- `https://developer.android.com/reference/android/app/FragmentController#retainLoaderNonConfig()`

### retainLoaderNonConfig

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ArrayMap<String, LoaderManager> retainLoaderNonConfig ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/ArrayMap<https://developer.android.com/reference/java/lang/String, https://developer.android.com/reference/android/app/LoaderManager>` | <br /> |

### retainNestedNonConfig

Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public FragmentManagerNonConfig retainNestedNonConfig ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/FragmentManagerNonConfig` | <br /> |

### retainNonConfig

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<Fragment> retainNonConfig ()
```

<br />

**This method was deprecated in API level 24.**   

use `https://developer.android.com/reference/android/app/FragmentController#retainNestedNonConfig()` to also track retained nested child fragments

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/app/Fragment>` | <br /> |

### saveAllState

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Parcelable saveAllState ()
```

Saves the state for all Fragments.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Parcelable` | <br /> |