added in version 26.1.0
belongs to Maven artifact com.android.support:support-tv-provider:28.0.0-alpha1
belongs to Maven artifact com.android.support:support-tv-provider:28.0.0-alpha1
Channel
public
final
class
Channel
extends Object
java.lang.Object | |
↳ | android.support.media.tv.Channel |
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") .setType(Channels.TYPE_PREVIEW) // Set more attributes... .build(); 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) { cursor.moveToNext(); channel = Channel.fromCursor(cursor); } }
Usage example when updating an existing channel:
Channel updatedChannel = new Channel.Builder(channel) .setDescription("New channel description") .build(); getContentResolver().update(TvContractCompat.buildChannelUri(updatedChannel.getId()), updatedChannel.toContentValues(), null, null);
Usage example when deleting a channel:
getContentResolver().delete( TvContractCompat.buildChannelUri(existingChannel.getId()), null, null);
Summary
Nested classes | |
---|---|
class |
Channel.Builder
The builder class that makes it easy to chain setters to create a |
Public methods | |
---|---|
boolean
|
equals(Object other)
|
static
Channel
|
fromCursor(Cursor cursor)
Creates a Channel object from a cursor including the fields defined in |
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()
|