Channel
public
final
class
Channel
extends Object
java.lang.Object
|
↳ |
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 |
class |
Channel.Builder
The builder class that makes it easy to chain setters to create a Channel object.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public methods
equals
public boolean equals (Object other)
fromCursor
public static Channel fromCursor (Cursor cursor)
Creates a Channel object from a cursor including the fields defined in TvContractCompat.Channels
.
Parameters |
cursor |
Cursor : A row from the TV Input Framework database. |
Returns |
Channel |
A channel with the values taken from the cursor.
|
getAppLinkColor
public int getAppLinkColor ()
getAppLinkIconUri
public Uri getAppLinkIconUri ()
getAppLinkIntent
public Intent getAppLinkIntent ()
Throws |
URISyntaxException |
|
getAppLinkIntentUri
public Uri getAppLinkIntentUri ()
getAppLinkPosterArtUri
public Uri getAppLinkPosterArtUri ()
getAppLinkText
public String getAppLinkText ()
getConfigurationDisplayOrder
public int getConfigurationDisplayOrder ()
getDescription
public String getDescription ()
getDisplayName
public String getDisplayName ()
getDisplayNumber
public String getDisplayNumber ()
getGlobalContentId
public String getGlobalContentId ()
getId
public long getId ()
public String getInputId ()
getInternalProviderDataByteArray
public byte[] getInternalProviderDataByteArray ()
getInternalProviderFlag1
public Long getInternalProviderFlag1 ()
getInternalProviderFlag2
public Long getInternalProviderFlag2 ()
getInternalProviderFlag3
public Long getInternalProviderFlag3 ()
getInternalProviderFlag4
public Long getInternalProviderFlag4 ()
getInternalProviderId
public String getInternalProviderId ()
getNetworkAffiliation
public String getNetworkAffiliation ()
getOriginalNetworkId
public int getOriginalNetworkId ()
getPackageName
public String getPackageName ()
getServiceId
public int getServiceId ()
getServiceType
public String getServiceType ()
getSystemChannelKey
public String getSystemChannelKey ()
getTransportStreamId
public int getTransportStreamId ()
getType
public String getType ()
public String getVideoFormat ()
hashCode
public int hashCode ()
isBrowsable
public boolean isBrowsable ()
isLocked
public boolean isLocked ()
isSearchable
public boolean isSearchable ()
isTransient
public boolean isTransient ()
toContentValues
public ContentValues toContentValues ()
Returns |
ContentValues |
The fields of the Channel in the ContentValues format to be easily inserted into the
TV Input Framework database.
|
toString
public String toString ()
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples/Code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-02-24 UTC.