Channel
class 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 types |
|---|
class Channel.BuilderThe builder class that makes it easy to chain setters to create a |
Public functions |
|
|---|---|
Boolean |
|
java-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<Byte>! |
|
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 functions
fromCursor
java-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. |
| Returns | |
|---|---|
Channel! |
A channel with the values taken from the cursor. |
getAppLinkColor
fun getAppLinkColor(): Int
| Returns | |
|---|---|
Int |
The value of |
getAppLinkIconUri
fun getAppLinkIconUri(): Uri!
| Returns | |
|---|---|
Uri! |
The value of |
getAppLinkIntent
fun getAppLinkIntent(): Intent!
| Returns | |
|---|---|
Intent! |
The value of |
| Throws | |
|---|---|
java.net.URISyntaxException |
getAppLinkIntentUri
fun getAppLinkIntentUri(): Uri!
| Returns | |
|---|---|
Uri! |
The value of |
getAppLinkPosterArtUri
fun getAppLinkPosterArtUri(): Uri!
| Returns | |
|---|---|
Uri! |
The value of |
getAppLinkText
fun getAppLinkText(): String!
| Returns | |
|---|---|
String! |
The value of |
getConfigurationDisplayOrder
fun getConfigurationDisplayOrder(): Int
| Returns | |
|---|---|
Int |
The value of |
getDescription
fun getDescription(): String!
| Returns | |
|---|---|
String! |
The value of |
getDisplayName
fun getDisplayName(): String!
| Returns | |
|---|---|
String! |
The value of |
getDisplayNumber
fun getDisplayNumber(): String!
| Returns | |
|---|---|
String! |
The value of |
getGlobalContentId
fun getGlobalContentId(): String?
| Returns | |
|---|---|
String? |
The value of |
getInputId
fun getInputId(): String!
| Returns | |
|---|---|
String! |
The value of |
getInternalProviderDataByteArray
fun getInternalProviderDataByteArray(): ByteArray<Byte>!
| Returns | |
|---|---|
ByteArray<Byte>! |
The value of |
getInternalProviderFlag1
fun getInternalProviderFlag1(): Long!
| Returns | |
|---|---|
Long! |
The value of |
getInternalProviderFlag2
fun getInternalProviderFlag2(): Long!
| Returns | |
|---|---|
Long! |
The value of |
getInternalProviderFlag3
fun getInternalProviderFlag3(): Long!
| Returns | |
|---|---|
Long! |
The value of |
getInternalProviderFlag4
fun getInternalProviderFlag4(): Long!
| Returns | |
|---|---|
Long! |
The value of |
getInternalProviderId
fun getInternalProviderId(): String!
| Returns | |
|---|---|
String! |
The value of |
getNetworkAffiliation
fun getNetworkAffiliation(): String!
| Returns | |
|---|---|
String! |
The value of |
getOriginalNetworkId
fun getOriginalNetworkId(): Int
| Returns | |
|---|---|
Int |
The value of |
getPackageName
fun getPackageName(): String!
| Returns | |
|---|---|
String! |
The value of |
getServiceId
fun getServiceId(): Int
| Returns | |
|---|---|
Int |
The value of |
getServiceType
fun getServiceType(): String!
| Returns | |
|---|---|
String! |
The value of Returns |
getSystemChannelKey
fun getSystemChannelKey(): String!
| Returns | |
|---|---|
String! |
The value of |
getTransportStreamId
fun getTransportStreamId(): Int
| Returns | |
|---|---|
Int |
The value of |
getType
fun getType(): String!
| Returns | |
|---|---|
String! |
The value of |
getVideoFormat
fun getVideoFormat(): String!
| Returns | |
|---|---|
String! |
The value of |
isBrowsable
fun isBrowsable(): Boolean
| Returns | |
|---|---|
Boolean |
The value of |
isLocked
fun isLocked(): Boolean
| Returns | |
|---|---|
Boolean |
The value of |
isSearchable
fun isSearchable(): Boolean
| Returns | |
|---|---|
Boolean |
The value of |
isTransient
fun isTransient(): Boolean
| Returns | |
|---|---|
Boolean |
The value of |
toContentValues
fun toContentValues(): ContentValues!
| Returns | |
|---|---|
ContentValues! |
The fields of the Channel in the ContentValues format to be easily inserted into the TV Input Framework database. |