added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)   
belongs to Maven artifact com.android.support:appcompat-v7:28.0.0-alpha1 Summary: [Constants](https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#constants) \| [Methods](https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#inhmethods) \| [\[Expand All\]](https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#)

# AppCompatDelegate

| This package is part of the Android [support library](https://developer.android.com/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](https://developer.android.com/jetpack/androidx) which is part of [Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](https://developer.android.com/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class
| mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).


`
public


abstract
class
AppCompatDelegate
`


`

extends Object


`

`


`

|---|---|
| java.lang.Object ||
| ↳ | android.support.v7.app.AppCompatDelegate |

<br />

*** ** * ** ***

This class represents a delegate which you can use to extend AppCompat's support to any
`https://developer.android.com/reference/android/app/Activity.html`.

When using an `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate`, you should call the following methods instead of the
`https://developer.android.com/reference/android/app/Activity.html` method of the same name:

- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#addContentView(android.view.View, android.view.ViewGroup.LayoutParams)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setContentView(int)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setContentView(android.view.View)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setContentView(android.view.View, android.view.ViewGroup.LayoutParams)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#requestWindowFeature(int)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#hasWindowFeature(int)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#invalidateOptionsMenu()`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#startSupportActionMode(android.support.v7.view.ActionMode.Callback)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setSupportActionBar(android.support.v7.widget.Toolbar)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#getSupportActionBar()`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#getMenuInflater()`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#findViewById(int)`

The following methods should be called from the `https://developer.android.com/reference/android/app/Activity.html` method of the
same name:

- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onCreate(android.os.Bundle)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onPostCreate(android.os.Bundle)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onConfigurationChanged(android.content.res.Configuration)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onStart()`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onStop()`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onPostResume()`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onSaveInstanceState(android.os.Bundle)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setTitle(java.lang.CharSequence)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onStop()`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onDestroy()`

An `https://developer.android.com/reference/android/app/Activity.html` can only be linked with one `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate` instance,
therefore the instance returned from `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#create(android.app.Activity, android.support.v7.app.AppCompatCallback)` should be
retained until the Activity is destroyed.

<br />

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#FEATURE_ACTION_MODE_OVERLAY` Flag for specifying the behavior of action modes when an Action Bar is not present. |
| `int` | `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#FEATURE_SUPPORT_ACTION_BAR` Flag for enabling the support Action Bar. |
| `int` | `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#FEATURE_SUPPORT_ACTION_BAR_OVERLAY` Flag for requesting an support Action Bar that overlays window content. |
| `int` | `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#MODE_NIGHT_AUTO` Mode which means to use night mode when it is determined that it is night or not. |
| `int` | `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#MODE_NIGHT_FOLLOW_SYSTEM` Mode which uses the system's night mode setting to determine if it is night or not. |
| `int` | `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#MODE_NIGHT_NO` Mode which means to not use night mode, and therefore prefer `notnight` qualified resources where available, regardless of the time. |
| `int` | `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#MODE_NIGHT_YES` Mode which means to always use night mode, and therefore prefer `night` qualified resources where available, regardless of the time. |

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#addContentView(android.view.View, android.view.ViewGroup.LayoutParams)(https://developer.android.com/reference/android/view/View.html v, https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html lp) ` Should be called instead of `https://developer.android.com/reference/android/app/Activity.html#addContentView(android.view.View, android.view.ViewGroup.LayoutParams)`} |
| ` abstract boolean` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#applyDayNight()() ` Allow AppCompat to apply the `night` and `notnight` resource qualifiers. |
| ` static https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#create(android.app.Dialog, android.support.v7.app.AppCompatCallback)(https://developer.android.com/reference/android/app/Dialog.html dialog, https://developer.android.com/reference/android/support/v7/app/AppCompatCallback callback) ` Create a `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate` to use with `dialog`. |
| ` static https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#create(android.app.Activity, android.support.v7.app.AppCompatCallback)(https://developer.android.com/reference/android/app/Activity.html activity, https://developer.android.com/reference/android/support/v7/app/AppCompatCallback callback) ` Create a `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate` to use with `activity`. |
| ` abstract https://developer.android.com/reference/android/view/View.html` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#createView(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet)(https://developer.android.com/reference/android/view/View.html parent, String name, https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/android/util/AttributeSet.html attrs) ` This should be called from a `https://developer.android.com/reference/android/view/LayoutInflater.Factory2.html` in order to return tint-aware widgets. |
| ` abstract <T extends https://developer.android.com/reference/android/view/View.html> T` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#findViewById(int)(int id) ` Finds a view that was identified by the id attribute from the XML that was processed in `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onCreate(android.os.Bundle)`. |
| ` static int` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#getDefaultNightMode()() ` Returns the default night mode. |
| ` abstract https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.Delegate` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#getDrawerToggleDelegate()() ` Returns an `https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.Delegate` which can be returned from your Activity if it implements `https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.DelegateProvider`. |
| ` abstract https://developer.android.com/reference/android/view/MenuInflater.html` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#getMenuInflater()() ` Return the value of this call from your `https://developer.android.com/reference/android/app/Activity.html#getMenuInflater()` |
| ` abstract https://developer.android.com/reference/android/support/v7/app/ActionBar` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#getSupportActionBar()() ` Support library version of `https://developer.android.com/reference/android/app/Activity.html#getActionBar()`. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#hasWindowFeature(int)(int featureId) ` Query for the availability of a certain feature. |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#installViewFactory()() ` Installs AppCompat's `https://developer.android.com/reference/android/view/LayoutInflater.html` Factory so that it can replace the framework widgets with compatible tinted versions. |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#invalidateOptionsMenu()() ` Should be called from `https://developer.android.com/reference/android/app/Activity.html#invalidateOptionsMenu()`} or `https://developer.android.com/reference/android/support/v4/app/FragmentActivity#supportInvalidateOptionsMenu()`. |
| ` static boolean` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#isCompatVectorFromResourcesEnabled()() ` Returns whether vector drawables on older platforms (\< API 21) can be accessed from within resources. |
| ` abstract boolean` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#isHandleNativeActionModesEnabled()() ` Returns whether AppCompat handles any native action modes itself. |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onConfigurationChanged(android.content.res.Configuration)(https://developer.android.com/reference/android/content/res/Configuration.html newConfig) ` Should be called from `https://developer.android.com/reference/android/app/Activity.html#onConfigurationChanged(android.content.res.Configuration)` |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onCreate(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html savedInstanceState) ` Should be called from `https://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle)`. |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onDestroy()() ` Should be called from `https://developer.android.com/reference/android/app/Activity.html#onDestroy()` |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onPostCreate(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html savedInstanceState) ` Should be called from `https://developer.android.com/reference/android/app/Activity.html#onPostCreate(android.os.Bundle)` |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onPostResume()() ` Should be called from `https://developer.android.com/reference/android/app/Activity.html#onPostResume()` |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onSaveInstanceState(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html outState) ` Allows AppCompat to save instance state. |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onStart()() ` Should be called from `https://developer.android.com/reference/android/app/Activity.html#onStart()` Activity.onStart()} |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onStop()() ` Should be called from `https://developer.android.com/reference/android/app/Activity.html#onStop()` |
| ` abstract boolean` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#requestWindowFeature(int)(int featureId) ` Enable extended window features. |
| ` static void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setCompatVectorFromResourcesEnabled(boolean)(boolean enabled) ` Sets whether vector drawables on older platforms (\< API 21) can be used within `https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.html` resources. |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setContentView(android.view.View)(https://developer.android.com/reference/android/view/View.html v) ` Should be called instead of `https://developer.android.com/reference/android/app/Activity.html#setContentView(android.view.View)`} |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setContentView(int)(int resId) ` Should be called instead of `https://developer.android.com/reference/android/app/Activity.html#setContentView(int)`} |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setContentView(android.view.View, android.view.ViewGroup.LayoutParams)(https://developer.android.com/reference/android/view/View.html v, https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html lp) ` Should be called instead of `https://developer.android.com/reference/android/app/Activity.html#setContentView(android.view.View, android.view.ViewGroup.LayoutParams)`} |
| ` static void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setDefaultNightMode(int)(int mode) ` Sets the default night mode. |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setHandleNativeActionModesEnabled(boolean)(boolean enabled) ` Whether AppCompat handles any native action modes itself. |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setLocalNightMode(int)(int mode) ` Override the night mode used for this delegate's host component. |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setSupportActionBar(android.support.v7.widget.Toolbar)(https://developer.android.com/reference/android/support/v7/widget/Toolbar toolbar) ` Set a `https://developer.android.com/reference/android/support/v7/widget/Toolbar` to act as the `https://developer.android.com/reference/android/support/v7/app/ActionBar` for this delegate. |
| ` abstract void` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setTitle(java.lang.CharSequence)(CharSequence title) ` Should be called from `https://developer.android.com/reference/android/app/Activity.html#onTitleChanged(java.lang.CharSequence, int)`} |
| ` abstract https://developer.android.com/reference/android/support/v7/view/ActionMode` | ` https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#startSupportActionMode(android.support.v7.view.ActionMode.Callback)(https://developer.android.com/reference/android/support/v7/view/ActionMode.Callback callback) ` Start an action mode. |

| ### Inherited methods |
|---|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#)From class ` java.lang.Object ` |---|---| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class<?>` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||

## Constants

### FEATURE_ACTION_MODE_OVERLAY

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
int FEATURE_ACTION_MODE_OVERLAY
```

Flag for specifying the behavior of action modes when an Action Bar is not present.
If overlay is enabled, the action mode UI will be allowed to cover existing window content.

<br />

Constant Value:

10
(0x0000000a)


### FEATURE_SUPPORT_ACTION_BAR

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
int FEATURE_SUPPORT_ACTION_BAR
```

Flag for enabling the support Action Bar.

This is enabled by default for some devices. The Action Bar replaces the title bar and
provides an alternate location for an on-screen menu button on some devices.

<br />

Constant Value:

108
(0x0000006c)


### FEATURE_SUPPORT_ACTION_BAR_OVERLAY

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
int FEATURE_SUPPORT_ACTION_BAR_OVERLAY
```

Flag for requesting an support Action Bar that overlays window content.
Normally an Action Bar will sit in the space above window content, but if this
feature is requested along with `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#FEATURE_SUPPORT_ACTION_BAR` it will be layered over
the window content itself. This is useful if you would like your app to have more control
over how the Action Bar is displayed, such as letting application content scroll beneath
an Action Bar with a transparent background or otherwise displaying a transparent/translucent
Action Bar over application content.

This mode is especially useful with `View.SYSTEM_UI_FLAG_FULLSCREEN`, which allows
you to seamlessly hide the action bar in conjunction with other screen decorations.
When an ActionBar is in this mode it will adjust the insets provided to
`https://developer.android.com/reference/android/view/View.html#fitSystemWindows(android.graphics.Rect)`
to include the content covered by the action bar, so you can do layout within
that space.

<br />

Constant Value:

109
(0x0000006d)


### MODE_NIGHT_AUTO

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
int MODE_NIGHT_AUTO
```

Mode which means to use night mode when it is determined that it is night or not.

The calculation used to determine whether it is night or not makes use of the location
APIs (if this app has the necessary permissions). This allows us to generate accurate
sunrise and sunset times. If this app does not have permission to access the location APIs
then we use hardcoded times which will be less accurate.

<br />

<br />

**See also:**

- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setLocalNightMode(int)`

Constant Value:

0
(0x00000000)


### MODE_NIGHT_FOLLOW_SYSTEM

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
int MODE_NIGHT_FOLLOW_SYSTEM
```

Mode which uses the system's night mode setting to determine if it is night or not.

<br />

**See also:**

- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setLocalNightMode(int)`

Constant Value:

-1
(0xffffffff)


### MODE_NIGHT_NO

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
int MODE_NIGHT_NO
```

Mode which means to not use night mode, and therefore prefer `notnight` qualified
resources where available, regardless of the time.

<br />

**See also:**

- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setLocalNightMode(int)`

Constant Value:

1
(0x00000001)


### MODE_NIGHT_YES

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
int MODE_NIGHT_YES
```

Mode which means to always use night mode, and therefore prefer `night` qualified
resources where available, regardless of the time.

<br />

**See also:**

- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setLocalNightMode(int)`

Constant Value:

2
(0x00000002)


## Public methods

### addContentView

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void addContentView (View v, 
                ViewGroup.LayoutParams lp)
```

Should be called instead of
`https://developer.android.com/reference/android/app/Activity.html#addContentView(android.view.View, android.view.ViewGroup.LayoutParams)`}

<br />

| Parameters ||
|---|---|
| `v` | `View` <br /> |
| `lp` | `ViewGroup.LayoutParams` <br /> |

### applyDayNight

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
boolean applyDayNight ()
```

Allow AppCompat to apply the `night` and `notnight` resource qualifiers.

Doing this enables the
`https://developer.android.com/reference/android/support/v7/appcompat/R.style#Theme_AppCompat_DayNight`
family of themes to work, using the computed twilight to automatically select a dark or
light theme.

You can override the night mode using `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setLocalNightMode(int)`.

This only works on devices running
`https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#ICE_CREAM_SANDWICH` and above.

If this is called after the host component has been created, the component will either be
automatically recreated or its `https://developer.android.com/reference/android/content/res/Configuration.html` updated. Which one depends on how
the component is setup (via `android:configChanges` or similar).

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if the night mode was applied, false if not <br /> |

**See also:**

- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setDefaultNightMode(int)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setLocalNightMode(int)`

### create

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
AppCompatDelegate create (Dialog dialog, 
                AppCompatCallback callback)
```

Create a `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate` to use with `dialog`.

<br />

| Parameters ||
|---|---|
| `dialog` | `Dialog` <br /> |
| `callback` | `AppCompatCallback`: An optional callback for AppCompat specific events <br /> |

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

### create

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
AppCompatDelegate create (Activity activity, 
                AppCompatCallback callback)
```

Create a `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate` to use with `activity`.

<br />

| Parameters ||
|---|---|
| `activity` | `Activity` <br /> |
| `callback` | `AppCompatCallback`: An optional callback for AppCompat specific events <br /> |

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

### createView

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

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

This should be called from a
`https://developer.android.com/reference/android/view/LayoutInflater.Factory2.html` in order
to return tint-aware widgets.


This is only needed if you are using your own
`https://developer.android.com/reference/android/view/LayoutInflater.html` factory, and have therefore not
installed the default factory via `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#installViewFactory()`.

<br />

| Parameters ||
|---|---|
| `parent` | `View` <br /> |
| `name` | `String` <br /> |
| `context` | `Context` <br /> |
| `attrs` | `AttributeSet` <br /> |

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

### findViewById

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
T findViewById (int id)
```

Finds a view that was identified by the id attribute from the XML that
was processed in `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#onCreate(android.os.Bundle)`.

<br />

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

| Returns ||
|---|---|
| `T` | The view if found or null otherwise. <br /> |

### getDefaultNightMode

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
int getDefaultNightMode ()
```

Returns the default night mode.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setDefaultNightMode(int)`

### getDrawerToggleDelegate

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
ActionBarDrawerToggle.Delegate getDrawerToggleDelegate ()
```

Returns an `https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.Delegate` which can be returned from your Activity
if it implements `https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.DelegateProvider`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.Delegate` | <br /> |

### getMenuInflater

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
MenuInflater getMenuInflater ()
```

Return the value of this call from your `https://developer.android.com/reference/android/app/Activity.html#getMenuInflater()`

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/MenuInflater.html` | <br /> |

### getSupportActionBar

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
ActionBar getSupportActionBar ()
```

Support library version of `https://developer.android.com/reference/android/app/Activity.html#getActionBar()`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/v7/app/ActionBar` | AppCompat's action bar, or null if it does not have one. <br /> |

### hasWindowFeature

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
boolean hasWindowFeature (int featureId)
```

Query for the availability of a certain feature.

This should be called instead of `https://developer.android.com/reference/android/view/Window.html#hasFeature(int)`.

<br />

<br />

| Parameters ||
|---|---|
| `featureId` | `int`: The feature ID to check <br /> |

| Returns ||
|---|---|
| `boolean` | true if the feature is enabled, false otherwise. <br /> |

### installViewFactory

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void installViewFactory ()
```

Installs AppCompat's `https://developer.android.com/reference/android/view/LayoutInflater.html` Factory so that it can replace
the framework widgets with compatible tinted versions. This should be called before
`super.onCreate()` as so:

```text
 protected void onCreate(Bundle savedInstanceState) {
     getDelegate().installViewFactory();
     getDelegate().onCreate(savedInstanceState);
     super.onCreate(savedInstanceState);

     // ...
 }
 
```
If you are using your own `https://developer.android.com/reference/android/view/LayoutInflater.Factory.html` or `https://developer.android.com/reference/android/view/LayoutInflater.Factory2.html` then you can omit this call, and instead call `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#createView(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet)` from your factory to return any compatible widgets.

<br />

<br />

### invalidateOptionsMenu

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void invalidateOptionsMenu ()
```

Should be called from `https://developer.android.com/reference/android/app/Activity.html#invalidateOptionsMenu()`} or
`https://developer.android.com/reference/android/support/v4/app/FragmentActivity#supportInvalidateOptionsMenu()`.

<br />

### isCompatVectorFromResourcesEnabled

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
boolean isCompatVectorFromResourcesEnabled ()
```

Returns whether vector drawables on older platforms (\< API 21) can be accessed from within
resources.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

**See also:**

- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setCompatVectorFromResourcesEnabled(boolean)`

### isHandleNativeActionModesEnabled

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
boolean isHandleNativeActionModesEnabled ()
```

Returns whether AppCompat handles any native action modes itself.

<br />

| Returns ||
|---|---|
| `boolean` | true if AppCompat should handle native action modes. <br /> |

### onConfigurationChanged

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void onConfigurationChanged (Configuration newConfig)
```

Should be called from
`https://developer.android.com/reference/android/app/Activity.html#onConfigurationChanged(android.content.res.Configuration)`

<br />

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

### onCreate

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void onCreate (Bundle savedInstanceState)
```

Should be called from `https://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle)`.

This should be called before `super.onCreate()` as so:

```text
 protected void onCreate(Bundle savedInstanceState) {
     getDelegate().onCreate(savedInstanceState);
     super.onCreate(savedInstanceState);
     // ...
 }
 
```

<br />

<br />

| Parameters ||
|---|---|
| `savedInstanceState` | `Bundle` <br /> |

### onDestroy

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void onDestroy ()
```

Should be called from `https://developer.android.com/reference/android/app/Activity.html#onDestroy()`

<br />

### onPostCreate

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void onPostCreate (Bundle savedInstanceState)
```

Should be called from `https://developer.android.com/reference/android/app/Activity.html#onPostCreate(android.os.Bundle)`

<br />

| Parameters ||
|---|---|
| `savedInstanceState` | `Bundle` <br /> |

### onPostResume

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void onPostResume ()
```

Should be called from `https://developer.android.com/reference/android/app/Activity.html#onPostResume()`

<br />

### onSaveInstanceState

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void onSaveInstanceState (Bundle outState)
```

Allows AppCompat to save instance state.

<br />

| Parameters ||
|---|---|
| `outState` | `Bundle` <br /> |

### onStart

added in [version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void onStart ()
```

Should be called from `https://developer.android.com/reference/android/app/Activity.html#onStart()` Activity.onStart()}

<br />

### onStop

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void onStop ()
```

Should be called from `https://developer.android.com/reference/android/app/Activity.html#onStop()`

<br />

### requestWindowFeature

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
boolean requestWindowFeature (int featureId)
```

Enable extended window features. This should be called instead of
`https://developer.android.com/reference/android/app/Activity.html#requestWindowFeature(int)` or
`https://developer.android.com/reference/android/view/Window.html#requestFeature(int)`.

<br />

| Parameters ||
|---|---|
| `featureId` | `int`: The desired feature as defined in `https://developer.android.com/reference/android/view/Window.html`. <br /> |

| Returns ||
|---|---|
| `boolean` | Returns true if the requested feature is supported and now enabled. <br /> |

### setCompatVectorFromResourcesEnabled

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void setCompatVectorFromResourcesEnabled (boolean enabled)
```

Sets whether vector drawables on older platforms (\< API 21) can be used within
`https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.html` resources.

When enabled, AppCompat can intercept some drawable inflation from the framework, which
enables implicit inflation of vector drawables within
`https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.html` resources. You can then use those
drawables in places such as `android:src` on `https://developer.android.com/reference/android/widget/ImageView.html`,
or `android:drawableLeft` on `https://developer.android.com/reference/android/widget/TextView.html`. Example usage:

```
 <selector xmlns:android="...">
     <item android:state_checked="true"
           android:drawable="@drawable/vector_checked_icon" />
     <item android:drawable="@drawable/vector_icon" />
 </selector>

 <TextView
         ...
         android:drawableLeft="@drawable/vector_state_list_icon" />
 
```

This feature defaults to disabled, since enabling it can cause issues with memory usage,
and problems updating `https://developer.android.com/reference/android/content/res/Configuration.html` instances. If you update the configuration
manually, then you probably do not want to enable this. You have been warned.

Even with this disabled, you can still use vector resources through
`https://developer.android.com/reference/android/support/v7/widget/AppCompatImageView#setImageResource(int)` and its
`app:srcCompat` attribute. They can also be used in anything which AppCompat inflates
for you, such as menu resources.

Please note: this only takes effect in Activities created after this call.

<br />

<br />

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

### setContentView

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void setContentView (View v)
```

Should be called instead of `https://developer.android.com/reference/android/app/Activity.html#setContentView(android.view.View)`}

<br />

| Parameters ||
|---|---|
| `v` | `View` <br /> |

### setContentView

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void setContentView (int resId)
```

Should be called instead of `https://developer.android.com/reference/android/app/Activity.html#setContentView(int)`}

<br />

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

### setContentView

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void setContentView (View v, 
                ViewGroup.LayoutParams lp)
```

Should be called instead of
`https://developer.android.com/reference/android/app/Activity.html#setContentView(android.view.View, android.view.ViewGroup.LayoutParams)`}

<br />

| Parameters ||
|---|---|
| `v` | `View` <br /> |
| `lp` | `ViewGroup.LayoutParams` <br /> |

### setDefaultNightMode

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void setDefaultNightMode (int mode)
```

Sets the default night mode. This is used across all activities/dialogs but can be overridden
locally via `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setLocalNightMode(int)`.

This method only takes effect for those situations where `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#applyDayNight()` works.
Defaults to `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#MODE_NIGHT_NO`.

This only takes effect for components which are created after the call. Any components
which are already open will not be updated.

<br />

<br />

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

**See also:**

- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#setLocalNightMode(int)`
- `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#getDefaultNightMode()`

### setHandleNativeActionModesEnabled

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void setHandleNativeActionModesEnabled (boolean enabled)
```

Whether AppCompat handles any native action modes itself.

This methods only takes effect on
`https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#ICE_CREAM_SANDWICH` and above.

<br />

| Parameters ||
|---|---|
| `enabled` | `boolean`: whether AppCompat should handle native action modes. <br /> |

### setLocalNightMode

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void setLocalNightMode (int mode)
```

Override the night mode used for this delegate's host component. This method only takes
effect for those situations where `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#applyDayNight()` works.

As this will call `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#applyDayNight()`, the host component might be
recreated automatically.

<br />

<br />

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

### setSupportActionBar

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void setSupportActionBar (Toolbar toolbar)
```

Set a `https://developer.android.com/reference/android/support/v7/widget/Toolbar` to act as the `https://developer.android.com/reference/android/support/v7/app/ActionBar` for this delegate.

When set to a non-null value the `https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#getSupportActionBar()` ()} method will return
an `https://developer.android.com/reference/android/support/v7/app/ActionBar` object that can be used to control the given toolbar as if it were
a traditional window decor action bar. The toolbar's menu will be populated with the
Activity's options menu and the navigation button will be wired through the standard
`https://developer.android.com/reference/android/R.id#home` menu select action.

In order to use a Toolbar within the Activity's window content the application
must not request the window feature
`https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate#FEATURE_SUPPORT_ACTION_BAR`.

<br />

<br />

| Parameters ||
|---|---|
| `toolbar` | `Toolbar`: Toolbar to set as the Activity's action bar, or `null` to clear it <br /> |

### setTitle

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
void setTitle (CharSequence title)
```

Should be called from `https://developer.android.com/reference/android/app/Activity.html#onTitleChanged(java.lang.CharSequence, int)`}

<br />

| Parameters ||
|---|---|
| `title` | `CharSequence` <br /> |

### startSupportActionMode

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
ActionMode startSupportActionMode (ActionMode.Callback callback)
```

Start an action mode.

<br />

| Parameters ||
|---|---|
| `callback` | `ActionMode.Callback`: Callback that will manage lifecycle events for this context mode <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/v7/view/ActionMode` | The ContextMode that was started, or null if it was canceled <br /> |

-

  ## Interfaces

  - [ActionBar.OnMenuVisibilityListener](https://developer.android.com/reference/android/support/v7/app/ActionBar.OnMenuVisibilityListener)
  - [ActionBar.OnNavigationListener](https://developer.android.com/reference/android/support/v7/app/ActionBar.OnNavigationListener)
  - [ActionBar.TabListener](https://developer.android.com/reference/android/support/v7/app/ActionBar.TabListener)
  - [ActionBarDrawerToggle.Delegate](https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.Delegate)
  - [ActionBarDrawerToggle.DelegateProvider](https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.DelegateProvider)
  - [AppCompatCallback](https://developer.android.com/reference/android/support/v7/app/AppCompatCallback)
-

  ## Classes

  - [ActionBar](https://developer.android.com/reference/android/support/v7/app/ActionBar)
  - [ActionBar.LayoutParams](https://developer.android.com/reference/android/support/v7/app/ActionBar.LayoutParams)
  - [ActionBar.Tab](https://developer.android.com/reference/android/support/v7/app/ActionBar.Tab)
  - [ActionBarDrawerToggle](https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle)
  - [AlertDialog](https://developer.android.com/reference/android/support/v7/app/AlertDialog)
  - [AlertDialog.Builder](https://developer.android.com/reference/android/support/v7/app/AlertDialog.Builder)
  - [AppCompatActivity](https://developer.android.com/reference/android/support/v7/app/AppCompatActivity)
  - [AppCompatDelegate](https://developer.android.com/reference/android/support/v7/app/AppCompatDelegate)
  - [AppCompatDialog](https://developer.android.com/reference/android/support/v7/app/AppCompatDialog)
  - [AppCompatDialogFragment](https://developer.android.com/reference/android/support/v7/app/AppCompatDialogFragment)
  - [AppCompatViewInflater](https://developer.android.com/reference/android/support/v7/app/AppCompatViewInflater)
  - [MediaRouteActionProvider](https://developer.android.com/reference/android/support/v7/app/MediaRouteActionProvider)
  - [MediaRouteButton](https://developer.android.com/reference/android/support/v7/app/MediaRouteButton)
  - [MediaRouteChooserDialog](https://developer.android.com/reference/android/support/v7/app/MediaRouteChooserDialog)
  - [MediaRouteChooserDialogFragment](https://developer.android.com/reference/android/support/v7/app/MediaRouteChooserDialogFragment)
  - [MediaRouteControllerDialog](https://developer.android.com/reference/android/support/v7/app/MediaRouteControllerDialog)
  - [MediaRouteControllerDialogFragment](https://developer.android.com/reference/android/support/v7/app/MediaRouteControllerDialogFragment)
  - [MediaRouteDialogFactory](https://developer.android.com/reference/android/support/v7/app/MediaRouteDialogFactory)
  - [MediaRouteDiscoveryFragment](https://developer.android.com/reference/android/support/v7/app/MediaRouteDiscoveryFragment)