# PreviewChannel.Builder

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.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/tvprovider#1.1.0)

*** ** * ** ***


```
public final class PreviewChannel.Builder
```

<br />

*** ** * ** ***

This builder makes it easy to create a PreviewChannel object by allowing you to chain setters. Even though this builder provides a no-arg constructor, certain fields are required or the `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#build()` method will throw an exception. The required fields are displayName and appLinkIntentUri; use the respective methods to set them.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#Builder()()` |
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#Builder(androidx.tvprovider.media.tv.PreviewChannel)(https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel other)` |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#build()()` Takes the values of the Builder object and creates a PreviewChannel object. |
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#setAppLinkIntent(android.content.Intent)(https://developer.android.com/reference/android/content/Intent.html appLinkIntent)` When user clicks on this channel's logo, the system will send an Intent for your app to open an Activity with contents relevant to this channel. |
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#setAppLinkIntentUri(android.net.Uri)(https://developer.android.com/reference/android/net/Uri.html appLinkIntentUri)` When user clicks on this channel's logo, the system will send an Intent for your app to open an Activity with contents relevant to this channel. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#setDescription(java.lang.CharSequence)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html description)` It's good practice to include a general description of the programs in this channel. |
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#setDisplayName(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence.html displayName)` This is the name user sees when your channel appears on their TV home screen. |
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#setInternalProviderData(byte[])(byte[] internalProviderData)` This is one of the optional fields that your app may set. |
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#setInternalProviderFlag1(long)(long flag)` This is one of the optional fields that your app may set. |
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#setInternalProviderFlag2(long)(long flag)` This is one of the optional fields that your app may set. |
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#setInternalProviderFlag3(long)(long flag)` This is one of the optional fields that your app may set. |
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#setInternalProviderFlag4(long)(long flag)` This is one of the optional fields that your app may set. |
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#setInternalProviderId(java.lang.String)(https://developer.android.com/reference/java/lang/String.html internalProviderId)` It is expected that your app or your server has its own internal representation (i.e. data structure) of channels. |
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#setLogo(android.graphics.Bitmap)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/Bitmap.html logoImage)` A logo visually identifies your channel. |
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder#setLogo(android.net.Uri)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/net/Uri.html logoUri)` A logo visually identifies your channel. |

## Public constructors

### Builder

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

```
public Builder()
```

### Builder

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

```
public Builder(PreviewChannel other)
```

## Public methods

### build

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

```
public PreviewChannel build()
```

Takes the values of the Builder object and creates a PreviewChannel object.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel` | PreviewChannel object with values from the Builder. |

### setAppLinkIntent

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

```
public PreviewChannel.Builder setAppLinkIntent(Intent appLinkIntent)
```

When user clicks on this channel's logo, the system will send an Intent for your app to open an Activity with contents relevant to this channel. Hence, the Intent data you provide here must point to content relevant to this channel.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | This Builder object to allow for chaining of calls to builder methods. |

### setAppLinkIntentUri

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

```
public PreviewChannel.Builder setAppLinkIntentUri(Uri appLinkIntentUri)
```

When user clicks on this channel's logo, the system will send an Intent for your app to open an Activity with contents relevant to this channel. Hence, the Uri you provide here must point to content relevant to this channel.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | This Builder object to allow for chaining of calls to builder methods. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_APP_LINK_INTENT_URI()` |   |

### setDescription

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

```
public @NonNull PreviewChannel.Builder setDescription(@Nullable CharSequence description)
```

It's good practice to include a general description of the programs in this channel.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | This Builder object to allow for chaining of calls to builder methods. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_DESCRIPTION()` |   |

### setDisplayName

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

```
public PreviewChannel.Builder setDisplayName(CharSequence displayName)
```

This is the name user sees when your channel appears on their TV home screen. For example "New Arrivals." This field is required.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | This Builder object to allow for chaining of calls to builder methods. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_DISPLAY_NAME()` |   |

### setInternalProviderData

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

```
public PreviewChannel.Builder setInternalProviderData(byte[] internalProviderData)
```

This is one of the optional fields that your app may set. Use these fields at your discretion to help you remember important information about this channel. For example, if this channel needs a byte array that is expensive for your app to construct, you may choose to save it here.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | This Builder object to allow for chaining of calls to builder methods. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_INTERNAL_PROVIDER_DATA()` |   |

### setInternalProviderFlag1

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

```
public PreviewChannel.Builder setInternalProviderFlag1(long flag)
```

This is one of the optional fields that your app may set. Use these fields at your discretion to help you remember important information about this channel. For example, you may use this flag to track additional data about this particular channel.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | This Builder object to allow for chaining of calls to builder methods. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_INTERNAL_PROVIDER_FLAG1()` |   |

### setInternalProviderFlag2

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

```
public PreviewChannel.Builder setInternalProviderFlag2(long flag)
```

This is one of the optional fields that your app may set. Use these fields at your discretion to help you remember important information about this channel. For example, you may use this flag to track additional data about this particular channel.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | This Builder object to allow for chaining of calls to builder methods. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_INTERNAL_PROVIDER_FLAG2()` |   |

### setInternalProviderFlag3

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

```
public PreviewChannel.Builder setInternalProviderFlag3(long flag)
```

This is one of the optional fields that your app may set. Use these fields at your discretion to help you remember important information about this channel. For example, you may use this flag to track additional data about this particular channel.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | This Builder object to allow for chaining of calls to builder methods. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_INTERNAL_PROVIDER_FLAG3()` |   |

### setInternalProviderFlag4

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

```
public PreviewChannel.Builder setInternalProviderFlag4(long flag)
```

This is one of the optional fields that your app may set. Use these fields at your discretion to help you remember important information about this channel. For example, you may use this flag to track additional data about this particular channel.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | This Builder object to allow for chaining of calls to builder methods. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_INTERNAL_PROVIDER_FLAG4()` |   |

### setInternalProviderId

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

```
public PreviewChannel.Builder setInternalProviderId(String internalProviderId)
```

It is expected that your app or your server has its own internal representation (i.e. data structure) of channels. It is highly recommended that you store your app/server's channel ID here; so that you may easily relate this published preview channel with the corresponding channel from your server. The `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannelHelper#publishChannel(androidx.tvprovider.media.tv.PreviewChannel)` method check this field to verify whether a preview channel being published would result in a duplicate. :

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | This Builder object to allow for chaining of calls to builder methods. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/TvContractCompat.Channels#COLUMN_INTERNAL_PROVIDER_ID()` |   |

### setLogo

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

```
public PreviewChannel.Builder setLogo(@NonNull Bitmap logoImage)
```

A logo visually identifies your channel. Hence, you should consider adding a unique logo to every channel you create, so user can quickly identify your channel.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | This Builder object to allow for chaining of calls to builder methods. |

### setLogo

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

```
public PreviewChannel.Builder setLogo(@NonNull Uri logoUri)
```

A logo visually identifies your channel. Hence, you should consider adding a unique logo to every channel you create, so user can quickly identify your channel.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/tvprovider/media/tv/PreviewChannel.Builder` | This Builder object to allow for chaining of calls to builder methods. |