added in version 26.1.0
belongs to Maven artifact


public final class PreviewProgram
extends Object


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

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

Usage example when inserting a preview program:

 PreviewProgram previewProgram = new PreviewProgram.Builder()
         .setTitle("Program Title")
         .setDescription("Program Description")
         // Set more attributes...
 Uri previewProgramUri = getContentResolver().insert(PreviewPrograms.CONTENT_URI,

Usage example when retrieving a preview program:

 PreviewProgram previewProgram;
 try (Cursor cursor = resolver.query(previewProgramUri, null, null, null, null)) {
     if (cursor != null && cursor.getCount() != 0) {
         previewProgram = PreviewProgram.fromCursor(cursor);

Usage example when updating an existing preview program:

 PreviewProgram updatedProgram = new PreviewProgram.Builder(previewProgram)
         updatedProgram.toContentValues(), null, null);

Usage example when deleting a preview program:

         null, null);


Nested classes

class PreviewProgram.Builder

This Builder class simplifies the creation of a PreviewProgram object. 

Public methods

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

Creates a Program object from a cursor including the fields defined in TvContractCompat.PreviewPrograms.

String[] getAudioLanguages()
String getAuthor()
int getAvailability()
String[] getCanonicalGenres()
long getChannelId()
String getContentId()
TvContentRating[] getContentRatings()
String getDescription()
int getDurationMillis()
long getEndTimeUtcMillis()
String getEpisodeNumber()
String getEpisodeTitle()
String getGenre()
long getId()
Intent getIntent()
Uri getIntentUri()
long getInteractionCount()
int getInteractionType()
byte[] getInternalProviderDataByteArray()