# DebugTextViewHelper

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/util/DebugTextViewHelper.java+class:androidx.media3.exoplayer.util.DebugTextViewHelper)

*** ** * ** ***


```
public class DebugTextViewHelper
```

<br />

*** ** * ** ***

A helper class for periodically updating a `https://developer.android.com/reference/android/widget/TextView.html` with debug information obtained from an `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/util/DebugTextViewHelper#DebugTextViewHelper(androidx.media3.exoplayer.ExoPlayer,android.widget.TextView)(https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer player, https://developer.android.com/reference/android/widget/TextView.html textView)` |

| ### Public methods |
|---|---|
| `final void` | `https://developer.android.com/reference/androidx/media3/exoplayer/util/DebugTextViewHelper#start()()` Starts periodic updates of the `https://developer.android.com/reference/android/widget/TextView.html`. |
| `final void` | `https://developer.android.com/reference/androidx/media3/exoplayer/util/DebugTextViewHelper#stop()()` Stops periodic updates of the `https://developer.android.com/reference/android/widget/TextView.html`. |

| ### Protected methods |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/exoplayer/util/DebugTextViewHelper#getAudioString()()` Returns a string containing audio debugging information. |
| `https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/exoplayer/util/DebugTextViewHelper#getDebugString()()` Returns the debugging information string to be shown by the target `https://developer.android.com/reference/android/widget/TextView.html`. |
| `https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/exoplayer/util/DebugTextViewHelper#getPlayerStateString()()` Returns a string containing player state debugging information. |
| `https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/exoplayer/util/DebugTextViewHelper#getVideoString()()` Returns a string containing video debugging information. |
| `final void` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/exoplayer/util/DebugTextViewHelper#updateAndPost()()` |

## Public constructors

### DebugTextViewHelper

```
public DebugTextViewHelper(ExoPlayer player, TextView textView)
```

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer player` | The `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer` from which debug information should be obtained. Only players which are accessed on the main thread are supported (` player.getApplicationLooper() == Looper.getMainLooper()`). |
| `https://developer.android.com/reference/android/widget/TextView.html textView` | The `https://developer.android.com/reference/android/widget/TextView.html` that should be updated to display the information. |

## Public methods

### start

```
public final void start()
```

Starts periodic updates of the `https://developer.android.com/reference/android/widget/TextView.html`. Must be called from the application's main thread.

### stop

```
public final void stop()
```

Stops periodic updates of the `https://developer.android.com/reference/android/widget/TextView.html`. Must be called from the application's main thread.

## Protected methods

### getAudioString

```
@UnstableApi
protected String getAudioString()
```

Returns a string containing audio debugging information.

### getDebugString

```
@UnstableApi
protected String getDebugString()
```

Returns the debugging information string to be shown by the target `https://developer.android.com/reference/android/widget/TextView.html`.

### getPlayerStateString

```
@UnstableApi
protected String getPlayerStateString()
```

Returns a string containing player state debugging information.

### getVideoString

```
@UnstableApi
protected String getVideoString()
```

Returns a string containing video debugging information.

### updateAndPost

```
@UnstableApi
protected final void updateAndPost()
```