# TabTemplate.TabCallback

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/TabTemplate.java+class:androidx.car.app.model.TabTemplate.TabCallback) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

*** ** * ** ***


```
public interface TabTemplate.TabCallback
```

<br />

*** ** * ** ***

A listener for tab selection.

## Summary

| ### Public methods |
|---|---|
| `default void` | `https://developer.android.com/reference/androidx/car/app/model/TabTemplate.TabCallback#onTabSelected(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html tabContentId)` Notifies the selected `Tab` has changed. |

## Public methods

### onTabSelected

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
default void onTabSelected(@NonNull String tabContentId)
```

Notifies the selected `Tab` has changed.

The host invokes this callback as the user selects a tab.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html tabContentId` | the content ID of the selected tab. |