# TvInteractiveAppManager.TvInteractiveAppCallback

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

# TvInteractiveAppCallback

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/media/tv/interactive/TvInteractiveAppManager.TvInteractiveAppCallback "View this page in Java")  

```
abstract class TvInteractiveAppCallback
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                                                                 ||
| ↳ | [android.media.tv.interactive.TvInteractiveAppManager.TvInteractiveAppCallback](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager.TvInteractiveAppCallback#) |

Callback used to monitor status of the TV Interactive App.

## Summary

|                                                                                        Public constructors                                                                                        ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [TvInteractiveAppCallback](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager.TvInteractiveAppCallback#TvInteractiveAppCallback())`()` <br /> |

|                                                                                                                                                                                                                                                                                                                                                                                              Public methods                                                                                                                                                                                                                                                                                                                                                                                               ||
|-----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onInteractiveAppServiceAdded](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager.TvInteractiveAppCallback#onInteractiveAppServiceAdded(kotlin.String))`(`iAppServiceId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` This is called when a TV Interactive App service is added to the system.                                                                                                                                                                                                                                                                                                                               |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onInteractiveAppServiceRemoved](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager.TvInteractiveAppCallback#onInteractiveAppServiceRemoved(kotlin.String))`(`iAppServiceId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` This is called when a TV Interactive App service is removed from the system.                                                                                                                                                                                                                                                                                                                       |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onInteractiveAppServiceUpdated](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager.TvInteractiveAppCallback#onInteractiveAppServiceUpdated(kotlin.String))`(`iAppServiceId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` This is called when a TV Interactive App service is updated on the system.                                                                                                                                                                                                                                                                                                                         |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onTvInteractiveAppServiceStateChanged](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager.TvInteractiveAppCallback#onTvInteractiveAppServiceStateChanged(kotlin.String,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int))`(`iAppServiceId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `type:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `state:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `err:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` This is called when the state of the interactive app service is changed. |

## Public constructors

### TvInteractiveAppCallback

```
TvInteractiveAppCallback()
```

## Public methods

### onInteractiveAppServiceAdded

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

```
open fun onInteractiveAppServiceAdded(iAppServiceId: String): Unit
```

This is called when a TV Interactive App service is added to the system.

Normally it happens when the user installs a new TV Interactive App service package that implements [TvInteractiveAppService](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppService) interface.

|                                                                                Parameters                                                                                 ||
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `iAppServiceId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The ID of the TV Interactive App service. This value cannot be `null`. |

### onInteractiveAppServiceRemoved

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

```
open fun onInteractiveAppServiceRemoved(iAppServiceId: String): Unit
```

This is called when a TV Interactive App service is removed from the system.

Normally it happens when the user uninstalls the previously installed TV Interactive App service package.

|                                                                                Parameters                                                                                 ||
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `iAppServiceId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The ID of the TV Interactive App service. This value cannot be `null`. |

### onInteractiveAppServiceUpdated

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

```
open fun onInteractiveAppServiceUpdated(iAppServiceId: String): Unit
```

This is called when a TV Interactive App service is updated on the system.

Normally it happens when a previously installed TV Interactive App service package is re-installed or a newer version of the package exists becomes available/unavailable.

|                                                                                Parameters                                                                                 ||
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `iAppServiceId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The ID of the TV Interactive App service. This value cannot be `null`. |

### onTvInteractiveAppServiceStateChanged

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

```
open fun onTvInteractiveAppServiceStateChanged(
    iAppServiceId: String, 
    type: Int, 
    state: Int, 
    err: Int
): Unit
```

This is called when the state of the interactive app service is changed.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ||
|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `iAppServiceId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The ID of the TV Interactive App service. This value cannot be `null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `type`          | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the interactive app type Value is [android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_HBBTV](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_HBBTV:kotlin.Int), [android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_ATSC](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_ATSC:kotlin.Int), [android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_GINGA](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_GINGA:kotlin.Int), [android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_TARGETED_AD](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_TARGETED_AD:kotlin.Int), or [android.media.tv.interactive.TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_OTHER](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppServiceInfo#INTERACTIVE_APP_TYPE_OTHER:kotlin.Int)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `state`         | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the current state of the service of the given type Value is [android.media.tv.interactive.TvInteractiveAppManager#SERVICE_STATE_UNREALIZED](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#SERVICE_STATE_UNREALIZED:kotlin.Int), [android.media.tv.interactive.TvInteractiveAppManager#SERVICE_STATE_PREPARING](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#SERVICE_STATE_PREPARING:kotlin.Int), [android.media.tv.interactive.TvInteractiveAppManager#SERVICE_STATE_READY](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#SERVICE_STATE_READY:kotlin.Int), or [android.media.tv.interactive.TvInteractiveAppManager#SERVICE_STATE_ERROR](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#SERVICE_STATE_ERROR:kotlin.Int)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `err`           | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the error code for error state. [ERROR_NONE](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#ERROR_NONE:kotlin.Int) is used when the state is not [SERVICE_STATE_ERROR](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#SERVICE_STATE_ERROR:kotlin.Int). Value is [android.media.tv.interactive.TvInteractiveAppManager#ERROR_NONE](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#ERROR_NONE:kotlin.Int), [android.media.tv.interactive.TvInteractiveAppManager#ERROR_UNKNOWN](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#ERROR_UNKNOWN:kotlin.Int), [android.media.tv.interactive.TvInteractiveAppManager#ERROR_NOT_SUPPORTED](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#ERROR_NOT_SUPPORTED:kotlin.Int), [android.media.tv.interactive.TvInteractiveAppManager#ERROR_WEAK_SIGNAL](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#ERROR_WEAK_SIGNAL:kotlin.Int), [android.media.tv.interactive.TvInteractiveAppManager#ERROR_RESOURCE_UNAVAILABLE](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#ERROR_RESOURCE_UNAVAILABLE:kotlin.Int), [android.media.tv.interactive.TvInteractiveAppManager#ERROR_BLOCKED](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#ERROR_BLOCKED:kotlin.Int), [android.media.tv.interactive.TvInteractiveAppManager#ERROR_ENCRYPTED](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#ERROR_ENCRYPTED:kotlin.Int), or [android.media.tv.interactive.TvInteractiveAppManager#ERROR_UNKNOWN_CHANNEL](https://developer.android.com/reference/kotlin/android/media/tv/interactive/TvInteractiveAppManager#ERROR_UNKNOWN_CHANNEL:kotlin.Int) |