# AppCompatCallback

Artifact: [androidx.appcompat:appcompat](https://developer.android.com/jetpack/androidx/releases/appcompat) [View Source](https://cs.android.com/search?q=file:androidx/appcompat/app/AppCompatCallback.java+class:androidx.appcompat.app.AppCompatCallback) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

*** ** * ** ***


```
interface AppCompatCallback
```

<br />

Known direct subclasses [AppCompatActivity](https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatActivity), [AppCompatDialog](https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatDialog)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatActivity` | Base class for activities that wish to use some of the newer platform features on older Android devices. |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatDialog` | Base class for AppCompat themed `https://developer.android.com/reference/android/app/Dialog.html`s. |

Known indirect subclasses [AlertDialog](https://developer.android.com/reference/kotlin/androidx/appcompat/app/AlertDialog), [MediaRouteChooserDialog](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteChooserDialog), [MediaRouteControllerDialog](https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteControllerDialog)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/app/AlertDialog` | A subclass of Dialog that can display one, two or three buttons. |
| `https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteChooserDialog` | This class implements the route chooser dialog for `https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouter`. |
| `https://developer.android.com/reference/kotlin/androidx/mediarouter/app/MediaRouteControllerDialog` | This class implements the route controller dialog for `https://developer.android.com/reference/kotlin/androidx/mediarouter/media/MediaRouter`. |

*** ** * ** ***

Implemented this in order for AppCompat to be able to callback in certain situations.

This should be provided to `https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatDelegate#create(android.app.Activity,androidx.appcompat.app.AppCompatCallback)`.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatCallback#onSupportActionModeFinished(androidx.appcompat.view.ActionMode)(mode: https://developer.android.com/reference/kotlin/androidx/appcompat/view/ActionMode!)` Called when a support action mode has finished. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatCallback#onSupportActionModeStarted(androidx.appcompat.view.ActionMode)(mode: https://developer.android.com/reference/kotlin/androidx/appcompat/view/ActionMode!)` Called when a support action mode has been started. |
| `https://developer.android.com/reference/kotlin/androidx/appcompat/view/ActionMode?` | `https://developer.android.com/reference/kotlin/androidx/appcompat/app/AppCompatCallback#onWindowStartingSupportActionMode(androidx.appcompat.view.ActionMode.Callback)(callback: https://developer.android.com/reference/kotlin/androidx/appcompat/view/ActionMode.Callback!)` Called when a support action mode is being started for this window. |

## Public functions

### onSupportActionModeFinished

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun onSupportActionModeFinished(mode: ActionMode!): Unit
```

Called when a support action mode has finished.

| Parameters |
|---|---|
| `mode: https://developer.android.com/reference/kotlin/androidx/appcompat/view/ActionMode!` | The action mode that just finished. |

### onSupportActionModeStarted

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun onSupportActionModeStarted(mode: ActionMode!): Unit
```

Called when a support action mode has been started.

| Parameters |
|---|---|
| `mode: https://developer.android.com/reference/kotlin/androidx/appcompat/view/ActionMode!` | The new action mode. |

### onWindowStartingSupportActionMode

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appcompat#1.1.0)

```
fun onWindowStartingSupportActionMode(callback: ActionMode.Callback!): ActionMode?
```

Called when a support action mode is being started for this window. Gives the callback an opportunity to handle the action mode in its own unique and beautiful way. If this method returns null the system can choose a way to present the mode or choose not to start the mode at all.

| Parameters |
|---|---|
| `callback: https://developer.android.com/reference/kotlin/androidx/appcompat/view/ActionMode.Callback!` | Callback to control the lifecycle of this action mode |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/appcompat/view/ActionMode?` | The ActionMode that was started, or null if the system should present it |