Channel
class Channel
kotlin.Any | |
↳ | androidx.tvprovider.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 | |
---|---|
The builder class that makes it easy to chain setters to create a |
Public methods | |
---|---|
Boolean | |
static Channel! |
fromCursor(cursor: Cursor!) Creates a Channel object from a cursor including the fields defined in |
Int | |
Uri! | |
Intent! | |
Uri! | |
Uri! | |
String! | |
Int | |
String! | |
String! | |
String! | |
String? | |
Long |
getId() |
String! | |
ByteArray! | |
Long! | |
Long! | |
Long! | |
Long! | |
String! | |
String! | |
Int | |
String! | |
Int | |
String! | |
String! | |
Int | |
String! |
getType() |
String! | |
Int |
hashCode() |
Boolean | |
Boolean |
isLocked() |
Boolean | |
Boolean | |
ContentValues! | |
String |
toString() |
Public methods
fromCursor
static fun fromCursor(cursor: Cursor!): Channel!
Creates a Channel object from a cursor including the fields defined in Channels
.
Parameters | |
---|---|
cursor |
Cursor!: A row from the TV Input Framework database. |
Return | |
---|---|
Channel! |
A channel with the values taken from the cursor. |
getAppLinkColor
fun getAppLinkColor(): Int
Return | |
---|---|
Int |
The value of Channels#COLUMN_APP_LINK_COLOR for the channel. |
getAppLinkIconUri
fun getAppLinkIconUri(): Uri!
Return | |
---|---|
Uri! |
The value of Channels#COLUMN_APP_LINK_ICON_URI for the channel. |
getAppLinkIntent
fun getAppLinkIntent(): Intent!
Return | |
---|---|
Intent! |
The value of Channels#COLUMN_APP_LINK_INTENT_URI for the program. |
getAppLinkIntentUri
fun getAppLinkIntentUri(): Uri!
Return | |
---|---|
Uri! |
The value of Channels#COLUMN_APP_LINK_INTENT_URI for the channel. |
getAppLinkPosterArtUri
fun getAppLinkPosterArtUri(): Uri!
Return | |
---|---|
Uri! |
The value of Channels#COLUMN_APP_LINK_POSTER_ART_URI for the channel. |
getAppLinkText
fun getAppLinkText(): String!
Return | |
---|---|
String! |
The value of Channels#COLUMN_APP_LINK_TEXT for the channel. |
getConfigurationDisplayOrder
fun getConfigurationDisplayOrder(): Int
Return | |
---|---|
Int |
The value of Channels#COLUMN_CONFIGURATION_DISPLAY_ORDER for the channel. |
getDescription
fun getDescription(): String!
Return | |
---|---|
String! |
The value of Channels#COLUMN_DESCRIPTION for the channel. |
getDisplayName
fun getDisplayName(): String!
Return | |
---|---|
String! |
The value of Channels#COLUMN_DISPLAY_NAME for the channel. |
getDisplayNumber
fun getDisplayNumber(): String!
Return | |
---|---|
String! |
The value of Channels#COLUMN_DISPLAY_NUMBER for the channel. |
getGlobalContentId
@Nullable fun getGlobalContentId(): String?
Return | |
---|---|
String? |
The value of Channels#COLUMN_GLOBAL_CONTENT_ID for the channel. |
getInputId
fun getInputId(): String!
Return | |
---|---|
String! |
The value of Channels#COLUMN_INPUT_ID for the channel. |
getInternalProviderDataByteArray
fun getInternalProviderDataByteArray(): ByteArray!
Return | |
---|---|
ByteArray! |
The value of Channels#COLUMN_INTERNAL_PROVIDER_DATA for the channel. |
getInternalProviderFlag1
fun getInternalProviderFlag1(): Long!
Return | |
---|---|
Long! |
The value of Channels#COLUMN_INTERNAL_PROVIDER_FLAG1 for the channel. |
getInternalProviderFlag2
fun getInternalProviderFlag2(): Long!
Return | |
---|---|
Long! |
The value of Channels#COLUMN_INTERNAL_PROVIDER_FLAG2 for the channel. |
getInternalProviderFlag3
fun getInternalProviderFlag3(): Long!
Return | |
---|---|
Long! |
The value of Channels#COLUMN_INTERNAL_PROVIDER_FLAG3 for the channel. |
getInternalProviderFlag4
fun getInternalProviderFlag4(): Long!
Return | |
---|---|
Long! |
The value of Channels#COLUMN_INTERNAL_PROVIDER_FLAG4 for the channel. |
getInternalProviderId
fun getInternalProviderId(): String!
Return | |
---|---|
String! |
The value of Channels#COLUMN_INTERNAL_PROVIDER_ID for the channel. |