added in version 26.1.0
belongs to Maven artifact


public final class Program
extends Object implements Comparable<Program>


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

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

Usage example when inserting a program:

 Program program = new Program.Builder()
         .setTitle("Program Title")
         .setDescription("Program Description")
         // Set more attributes...
 Uri programUri = getContentResolver().insert(Programs.CONTENT_URI, program.toContentValues());

Usage example when retrieving a program:

 Program program;
 try (Cursor cursor = resolver.query(programUri, null, null, null, null)) {
     if (cursor != null && cursor.getCount() != 0) {
         program = Program.fromCursor(cursor);

Usage example when updating an existing program:

 Program updatedProgram = new Program.Builder(program)
         updatedProgram.toContentValues(), null, null);

Usage example when deleting a program:

         null, null);


Nested classes

class Program.Builder

This Builder class simplifies the creation of a Program object. 

Public methods

int compareTo(Program other)
boolean equals(Object other)
static Program fromCursor(Cursor cursor)

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

String[] getAudioLanguages()
String[] getBroadcastGenres()
String[] getCanonicalGenres()
long getChannelId()
TvContentRating[] getContentRatings()
String getDescription()
long getEndTimeUtcMillis()
String getEpisodeNumber()
String getEpisodeTitle()
long getId()
byte[] getInternalProviderDataByteArray()
Long getInternalProviderFlag1()
Long getInternalProviderFlag2()
Long getInternalProviderFlag3()
Long getInternalProviderFlag4()
String getLongDescription()
Uri getPosterArtUri()
String getReviewRating()
int getReviewRatingStyle()