# PreviewChannel

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

*** ** * ** ***

<br />

```
class PreviewChannel
```

<br />

*** ** * ** ***

Since API 26, all TV apps may create preview channels and publish them to the home screen. We call these App Channels (as distinct from the Live Channels row on the home screen). To help you create App Channels, the support library provides a number of classes prefixed by the word Preview-. This is a convenience class for mapping your app's content into a `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/TvContractCompat` for publication. Use the provided `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel.Builder` for creating your preview channel object. Once you create a preview channel, you can use `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannelHelper` to publish it and add `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewProgram` to it.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel.Builder` This builder makes it easy to create a PreviewChannel object by allowing you to chain setters. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#equals(java.lang.Object)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `java-static https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel?` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#fromCursor(android.database.Cursor)(cursor: https://developer.android.com/reference/android/database/Cursor.html!)` Used by `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannelHelper` to transduce a TvProvider channel row into a PreviewChannel Java object. |
| `https://developer.android.com/reference/android/content/Intent.html!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getAppLinkIntent()()` |
| `https://developer.android.com/reference/android/net/Uri.html!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getAppLinkIntentUri()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getDescription()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getDisplayName()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getId()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getInternalProviderDataByteArray()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getInternalProviderFlag1()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getInternalProviderFlag2()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getInternalProviderFlag3()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getInternalProviderFlag4()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getInternalProviderId()()` |
| `https://developer.android.com/reference/android/graphics/Bitmap.html!` | `@https://developer.android.com/reference/kotlin/androidx/annotation/WorkerThread https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getLogo(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html!)` This method should be called on a worker thread since decoding Bitmap is an expensive operation and therefore should not be performed on the main thread. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getPackageName()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#getType()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#hasAnyUpdatedValues(androidx.tvprovider.media.tv.PreviewChannel)(update: https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel!)` Indicates whether some other PreviewChannel has any set attribute that is different from this PreviewChannel's respective attributes. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#isBrowsable()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel#toString()()` |

## Public functions

### equals

```
fun equals(other: Any!): Boolean
```

### fromCursor

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

```
java-static fun fromCursor(cursor: Cursor!): PreviewChannel?
```

Used by `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannelHelper` to transduce a TvProvider channel row into a PreviewChannel Java object. You never need to use this method unless you want to convert database rows to PreviewChannel objects yourself.
This method assumes the cursor was obtained using `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/package-summary`. This way, all indices are known beforehand.

| Parameters |
|---|---|
| `cursor: https://developer.android.com/reference/android/database/Cursor.html!` | a cursor row from the TvProvider |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/PreviewChannel?` | a PreviewChannel whose values come from the cursor row or `null` if the cursor is not pointing at a preview channel. |

### getAppLinkIntent

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

```
fun getAppLinkIntent(): Intent!
```

| Returns |
|---|---|
| `https://developer.android.com/reference/android/content/Intent.html!` | The value of `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_APP_LINK_INTENT_URI()` for the program. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/net/URISyntaxException.html` |   |

### getAppLinkIntentUri

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

```
fun getAppLinkIntentUri(): Uri!
```

| Returns |
|---|---|
| `https://developer.android.com/reference/android/net/Uri.html!` | The value of `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_APP_LINK_INTENT_URI()` for the channel. |

### getDescription

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

```
fun getDescription(): CharSequence!
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!` | The value of `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_DESCRIPTION()` for the channel. A short text explaining what this channel contains. |

### getDisplayName

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

```
fun getDisplayName(): CharSequence!
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html!` | The name users see when this channel appears on the home screen |

### getId

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

```
fun getId(): Long
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | the ID the system assigns to this preview channel upon publication. |

### getInternalProviderDataByteArray

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

```
fun getInternalProviderDataByteArray(): Array<Byte>!
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!` | The value of `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_INTERNAL_PROVIDER_DATA()` for the channel. |

### getInternalProviderFlag1

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

```
fun getInternalProviderFlag1(): Long!
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html!` | The value of `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_INTERNAL_PROVIDER_FLAG1()` for the channel. |

### getInternalProviderFlag2

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

```
fun getInternalProviderFlag2(): Long!
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html!` | The value of `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_INTERNAL_PROVIDER_FLAG2()` for the channel. |

### getInternalProviderFlag3

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

```
fun getInternalProviderFlag3(): Long!
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html!` | The value of `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_INTERNAL_PROVIDER_FLAG3()` for the channel. |

### getInternalProviderFlag4

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

```
fun getInternalProviderFlag4(): Long!
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html!` | The value of `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_INTERNAL_PROVIDER_FLAG4()` for the channel. |

### getInternalProviderId

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

```
fun getInternalProviderId(): String!
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The value of `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_INTERNAL_PROVIDER_ID()` for the channel. |

### getLogo

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

```
@WorkerThread
fun getLogo(context: Context!): Bitmap!
```

This method should be called on a worker thread since decoding Bitmap is an expensive operation and therefore should not be performed on the main thread.

| Returns |
|---|---|
| `https://developer.android.com/reference/android/graphics/Bitmap.html!` | The logo associated with this preview channel |

### getPackageName

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

```
fun getPackageName(): String!
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | package name of the app that created this channel |

### getType

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

```
fun getType(): String!
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | what type of channel this is. For preview channels, the type is always TvContractCompat.Channels.TYPE_PREVIEW |

### hasAnyUpdatedValues

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

```
fun hasAnyUpdatedValues(update: PreviewChannel!): Boolean
```

Indicates whether some other PreviewChannel has any set attribute that is different from this PreviewChannel's respective attributes. An attribute is considered "set" if its key is present in the ContentValues vector.

### hashCode

```
fun hashCode(): Int
```

### isBrowsable

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

```
fun isBrowsable(): Boolean
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | The value of `https://developer.android.com/reference/kotlin/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_BROWSABLE()` for the channel. A preview channel is BROWABLE when it is visible on the TV home screen. |

### toString

```
fun toString(): String!
```