added in version 26.1.0
belongs to Maven artifact


public final class Channel
extends Object


A convenience class to access TvContractCompat.Channels entries in the system content provider.

This class makes it easy to insert or retrieve a channel from the system content provider, which is defined in TvContractCompat.

Usage example when inserting a channel:

 Channel channel = new Channel.Builder()
         .setDisplayName("Channel Name")
         .setDescription("Channel description")
         // Set more attributes...
 Uri channelUri = getContentResolver().insert(Channels.CONTENT_URI, channel.toContentValues());

Usage example when retrieving a channel:

 Channel channel;
 try (Cursor cursor = resolver.query(channelUri, null, null, null, null)) {
     if (cursor != null && cursor.getCount() != 0) {
         channel = Channel.fromCursor(cursor);

Usage example when updating an existing channel:

 Channel updatedChannel = new Channel.Builder(channel)
         .setDescription("New channel description")
         updatedChannel.toContentValues(), null, null);

Usage example when deleting a channel:

         TvContractCompat.buildChannelUri(existingChannel.getId()), null, null);


Nested classes

class Channel.Builder

The builder class that makes it easy to chain setters to create a Channel object. 

Public methods

boolean equals(Object other)
static Channel fromCursor(Cursor cursor)

Creates a Channel object from a cursor including the fields defined in TvContractCompat.Channels.

int getAppLinkColor()
Uri getAppLinkIconUri()
Intent getAppLinkIntent()
Uri getAppLinkIntentUri()
Uri getAppLinkPosterArtUri()
String getAppLinkText()
int getConfigurationDisplayOrder()
String getDescription()
String getDisplayName()
String getDisplayNumber()
long getId()
String getInputId()
byte[] getInternalProviderDataByteArray()
Long getInternalProviderFlag1()
Long getInternalProviderFlag2()
Long getInternalProviderFlag3()
Long getInternalProviderFlag4()
String getInternalProviderId()
String getNetworkAffiliation()