# ContentRecommendation

Artifact: [androidx.recommendation:recommendation](https://developer.android.com/jetpack/androidx/releases/recommendation) [View Source](https://cs.android.com/search?q=file:androidx/recommendation/app/ContentRecommendation.java+class:androidx.recommendation.app.ContentRecommendation) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

*** ** * ** ***


```
public final class ContentRecommendation
```

<br />

*** ** * ** ***

The ContentRecommendation object encapsulates all application provided data for a single content recommendation item.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder` Builder class for `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation` objects. |
| `@https://developer.android.com/reference/androidx/annotation/StringDef(value = ) @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) public annotation https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.ContentMaturity` |
| `@https://developer.android.com/reference/androidx/annotation/StringDef(value = ) @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) public annotation https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.ContentPricing` |
| `@https://developer.android.com/reference/androidx/annotation/IntDef(value = ) @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) public annotation https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.ContentStatus` |
| `@https://developer.android.com/reference/androidx/annotation/StringDef(value = ) @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) public annotation https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.ContentType` |
| `public class https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.IntentData` Object used to encapsulate the data to be used to build the `https://developer.android.com/reference/android/app/PendingIntent.html` object associated with a given content recommendation, at the time this recommendation gets posted to the home Screen. |
| `@https://developer.android.com/reference/androidx/annotation/IntDef(value = ) @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) public annotation https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.IntentType` |

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_MATURITY_ALL() = "android.contentMaturity.all"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setMaturityRating(java.lang.String)` to indicate that the content referred by the notification is suitable for all audiences. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_MATURITY_HIGH() = "android.contentMaturity.high"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setMaturityRating(java.lang.String)` to indicate that the content referred by the notification is suitable for audiences of high maturity and above. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_MATURITY_LOW() = "android.contentMaturity.low"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setMaturityRating(java.lang.String)` to indicate that the content referred by the notification is suitable for audiences of low maturity and above. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_MATURITY_MEDIUM() = "android.contentMaturity.medium"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setMaturityRating(java.lang.String)` to indicate that the content referred by the notification is suitable for audiences of medium maturity and above. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_PRICING_FREE() = "android.contentPrice.free"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setPricingInformation(java.lang.String,java.lang.String)` to indicate that the content referred by the notification item is free to consume. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_PRICING_PREORDER() = "android.contentPrice.preorder"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setPricingInformation(java.lang.String,java.lang.String)` to indicate that the content referred by the notification item is available currently as a pre-order, and the price value provided is the purchase price for the item. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_PRICING_PURCHASE() = "android.contentPrice.purchase"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setPricingInformation(java.lang.String,java.lang.String)` to indicate that the content referred by the notification item is available for purchase, and the price value provided is the purchase price for the item. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_PRICING_RENTAL() = "android.contentPrice.rental"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setPricingInformation(java.lang.String,java.lang.String)` to indicate that the content referred by the notification item is available as a rental, and the price value provided is the rental price for the item. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_PRICING_SUBSCRIPTION() = "android.contentPrice.subscription"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setPricingInformation(java.lang.String,java.lang.String)` to indicate that the content referred by the notification item is available as part of a subscription based service, and the price value provided is the subscription price for the service. |
| `static final int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_STATUS_AVAILABLE() = 2` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setStatus(int)` to indicate that the content referred by the notification is available, but needs to be first purchased, rented, subscribed or downloaded before it can be consumed. |
| `static final int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_STATUS_PENDING() = 1` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setStatus(int)` to indicate that the content referred by the notification is pending, waiting on either a download or purchase operation to complete before it can be consumed. |
| `static final int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_STATUS_READY() = 0` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setStatus(int)` to indicate that the content referred by the notification is available and ready to be consumed immediately. |
| `static final int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_STATUS_UNAVAILABLE() = 3` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setStatus(int)` to indicate that the content referred by the notification is not available. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_APP() = "android.contentType.app"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is an application. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_BOOK() = "android.contentType.book"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a book. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_COMIC() = "android.contentType.comic"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a comic book. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_GAME() = "android.contentType.game"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a game. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_MAGAZINE() = "android.contentType.magazine"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a magazine. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_MOVIE() = "android.contentType.movie"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a movie. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_MUSIC() = "android.contentType.music"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a song or album. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_NEWS() = "android.contentType.news"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a news item. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_PODCAST() = "android.contentType.podcast"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a podcast. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_RADIO() = "android.contentType.radio"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a radio station. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_SERIAL() = "android.contentType.serial"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is serial. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_SPORTS() = "android.contentType.sports"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is sports. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_TRAILER() = "android.contentType.trailer"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a trailer. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_VIDEO() = "android.contentType.video"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a video clip. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#CONTENT_TYPE_WEBSITE() = "android.contentType.website"` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a website. |
| `static final int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#INTENT_TYPE_ACTIVITY() = 1` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentIntentData(int,android.content.Intent,int,android.os.Bundle)` and `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setDismissIntentData(int,android.content.Intent,int,android.os.Bundle)` to indicate that a `https://developer.android.com/reference/android/app/PendingIntent.html` for an Activity should be created when posting the recommendation to the HomeScreen. |
| `static final int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#INTENT_TYPE_BROADCAST() = 2` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentIntentData(int,android.content.Intent,int,android.os.Bundle)` and `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setDismissIntentData(int,android.content.Intent,int,android.os.Bundle)` to indicate that a `https://developer.android.com/reference/android/app/PendingIntent.html` for a Broadcast should be created when posting the recommendation to the HomeScreen. |
| `static final int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#INTENT_TYPE_SERVICE() = 3` Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentIntentData(int,android.content.Intent,int,android.os.Bundle)` and `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setDismissIntentData(int,android.content.Intent,int,android.os.Bundle)` to indicate that a `https://developer.android.com/reference/android/app/PendingIntent.html` for a Service should be created when posting the recommendation to the HomeScreen. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getBackgroundImageUri()()` Returns a Content URI that can be used to retrieve the background image for this recommendation. |
| `int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getBadgeImageResourceId()()` Returns the resource id for the recommendation badging icon. |
| `int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getColor()()` Returns the accent color value to be used in the UI when displaying this content recommendation to the user. |
| `https://developer.android.com/reference/android/graphics/Bitmap.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getContentImage()()` Returns the Bitmap containing the recommendation image. |
| `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.IntentData` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getContentIntent()()` Returns the data for the Intent that will be issued when the user clicks on the recommendation. |
| `String[]` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getContentTypes()()` Returns an array containing the content types tags that describe the content. |
| `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.IntentData` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getDismissIntent()()` Returns the data for the Intent that will be issued when the recommendation gets dismissed from the Home Screen, due to an user action. |
| `String[]` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getGenres()()` Returns an array containing the genres that describe the content. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getGroup()()` Returns the String group ID tag for this recommendation. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getIdTag()()` Returns the String Id tag which uniquely identifies this recommendation. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getMaturityRating()()` Returns the maturity level rating for the content. |
| `https://developer.android.com/reference/android/app/Notification.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getNotificationObject(android.content.Context)(https://developer.android.com/reference/android/content/Context.html context)` Returns a `https://developer.android.com/reference/android/app/Notification.html` object which contains the content recommendation data encapsulated by this object, which can be used for posting the recommendation via the `https://developer.android.com/reference/android/app/NotificationManager.html`. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getPricingType()()` Gets the pricing type for the content. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getPricingValue()()` Gets the price value (when applicable) for the content. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getPrimaryContentType()()` Returns the primary content type tag for the recommendation, or null if no content types have been specified. |
| `int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getProgressMax()()` Returns the maximum value for the progress data of this recommendation. |
| `int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getProgressValue()()` Returns the progress amount for this recommendation. |
| `long` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getRunningTime()()` Returns the running time for the content. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getSortKey()()` Returns the String sort key for this recommendation. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getSourceName()()` Returns the source application name for this recommendation. |
| `int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getStatus()()` Returns availability status value for the content. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getText()()` Returns the description text for this recommendation. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#getTitle()()` Returns the content title for this recommendation. |
| `boolean` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#hasProgressInfo()()` Indicates if this recommendation contains valid progress information. |
| `int` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#hashCode()()` |
| `boolean` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#isAutoDismiss()()` Indicates whether this recommendation should be dismissed automatically. |
| `void` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#setAutoDismiss(boolean)(boolean autoDismiss)` Sets the flag indicating if this recommendation should be dismissed automatically. |
| `void` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#setGroup(java.lang.String)(https://developer.android.com/reference/java/lang/String.html groupTag)` Sets the String group ID tag for this recommendation. |
| `void` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#setProgress(int,int)(int max, int progress)` Sets the progress information for the content pointed to by this recommendation. |
| `void` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#setSortKey(java.lang.String)(https://developer.android.com/reference/java/lang/String.html sortKey)` Sets the String sort key for this recommendation. |
| `void` | `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation#setStatus(int)(@https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.ContentStatus int status)` Sets the availability status value for the content. |

## Constants

### CONTENT_MATURITY_ALL

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_MATURITY_ALL = "android.contentMaturity.all"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setMaturityRating(java.lang.String)` to indicate that the content referred by the notification is suitable for all audiences.

### CONTENT_MATURITY_HIGH

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_MATURITY_HIGH = "android.contentMaturity.high"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setMaturityRating(java.lang.String)` to indicate that the content referred by the notification is suitable for audiences of high maturity and above.

### CONTENT_MATURITY_LOW

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_MATURITY_LOW = "android.contentMaturity.low"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setMaturityRating(java.lang.String)` to indicate that the content referred by the notification is suitable for audiences of low maturity and above.

### CONTENT_MATURITY_MEDIUM

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_MATURITY_MEDIUM = "android.contentMaturity.medium"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setMaturityRating(java.lang.String)` to indicate that the content referred by the notification is suitable for audiences of medium maturity and above.

### CONTENT_PRICING_FREE

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_PRICING_FREE = "android.contentPrice.free"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setPricingInformation(java.lang.String,java.lang.String)` to indicate that the content referred by the notification item is free to consume.

### CONTENT_PRICING_PREORDER

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_PRICING_PREORDER = "android.contentPrice.preorder"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setPricingInformation(java.lang.String,java.lang.String)` to indicate that the content referred by the notification item is available currently as a pre-order, and the price value provided is the purchase price for the item.

### CONTENT_PRICING_PURCHASE

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_PRICING_PURCHASE = "android.contentPrice.purchase"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setPricingInformation(java.lang.String,java.lang.String)` to indicate that the content referred by the notification item is available for purchase, and the price value provided is the purchase price for the item.

### CONTENT_PRICING_RENTAL

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_PRICING_RENTAL = "android.contentPrice.rental"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setPricingInformation(java.lang.String,java.lang.String)` to indicate that the content referred by the notification item is available as a rental, and the price value provided is the rental price for the item.

### CONTENT_PRICING_SUBSCRIPTION

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_PRICING_SUBSCRIPTION = "android.contentPrice.subscription"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setPricingInformation(java.lang.String,java.lang.String)` to indicate that the content referred by the notification item is available as part of a subscription based service, and the price value provided is the subscription price for the service.

### CONTENT_STATUS_AVAILABLE

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final int CONTENT_STATUS_AVAILABLE = 2
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setStatus(int)` to indicate that the content referred by the notification is available, but needs to be first purchased, rented, subscribed or downloaded before it can be consumed.

### CONTENT_STATUS_PENDING

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final int CONTENT_STATUS_PENDING = 1
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setStatus(int)` to indicate that the content referred by the notification is pending, waiting on either a download or purchase operation to complete before it can be consumed.

### CONTENT_STATUS_READY

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final int CONTENT_STATUS_READY = 0
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setStatus(int)` to indicate that the content referred by the notification is available and ready to be consumed immediately.

### CONTENT_STATUS_UNAVAILABLE

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final int CONTENT_STATUS_UNAVAILABLE = 3
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setStatus(int)` to indicate that the content referred by the notification is not available. This could be content not available in a certain region or incompatible with the device in use.

### CONTENT_TYPE_APP

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_APP = "android.contentType.app"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is an application.

### CONTENT_TYPE_BOOK

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_BOOK = "android.contentType.book"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a book.

### CONTENT_TYPE_COMIC

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_COMIC = "android.contentType.comic"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a comic book.

### CONTENT_TYPE_GAME

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_GAME = "android.contentType.game"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a game.

### CONTENT_TYPE_MAGAZINE

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_MAGAZINE = "android.contentType.magazine"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a magazine.

### CONTENT_TYPE_MOVIE

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_MOVIE = "android.contentType.movie"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a movie.

### CONTENT_TYPE_MUSIC

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_MUSIC = "android.contentType.music"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a song or album.

### CONTENT_TYPE_NEWS

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_NEWS = "android.contentType.news"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a news item.

### CONTENT_TYPE_PODCAST

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_PODCAST = "android.contentType.podcast"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a podcast.

### CONTENT_TYPE_RADIO

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_RADIO = "android.contentType.radio"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a radio station.

### CONTENT_TYPE_SERIAL

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_SERIAL = "android.contentType.serial"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is serial. It can refer to an entire show, a single season or series, or a single episode.

### CONTENT_TYPE_SPORTS

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_SPORTS = "android.contentType.sports"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is sports.

### CONTENT_TYPE_TRAILER

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_TRAILER = "android.contentType.trailer"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a trailer.

### CONTENT_TYPE_VIDEO

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_VIDEO = "android.contentType.video"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a video clip.

### CONTENT_TYPE_WEBSITE

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final String CONTENT_TYPE_WEBSITE = "android.contentType.website"
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentTypes(java.lang.String[])` to indicate that the content referred by the notification item is a website.

### INTENT_TYPE_ACTIVITY

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final int INTENT_TYPE_ACTIVITY = 1
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentIntentData(int,android.content.Intent,int,android.os.Bundle)` and `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setDismissIntentData(int,android.content.Intent,int,android.os.Bundle)` to indicate that a `https://developer.android.com/reference/android/app/PendingIntent.html` for an Activity should be created when posting the recommendation to the HomeScreen.

### INTENT_TYPE_BROADCAST

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final int INTENT_TYPE_BROADCAST = 2
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentIntentData(int,android.content.Intent,int,android.os.Bundle)` and `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setDismissIntentData(int,android.content.Intent,int,android.os.Bundle)` to indicate that a `https://developer.android.com/reference/android/app/PendingIntent.html` for a Broadcast should be created when posting the recommendation to the HomeScreen.

### INTENT_TYPE_SERVICE

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public static final int INTENT_TYPE_SERVICE = 3
```

Value to be used with `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setContentIntentData(int,android.content.Intent,int,android.os.Bundle)` and `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.Builder#setDismissIntentData(int,android.content.Intent,int,android.os.Bundle)` to indicate that a `https://developer.android.com/reference/android/app/PendingIntent.html` for a Service should be created when posting the recommendation to the HomeScreen.

## Public methods

### equals

```
public boolean equals(Object other)
```

### getBackgroundImageUri

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String getBackgroundImageUri()
```

Returns a Content URI that can be used to retrieve the background image for this recommendation.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | A Content URI pointing to the recommendation background image. |

### getBadgeImageResourceId

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public int getBadgeImageResourceId()
```

Returns the resource id for the recommendation badging icon.

The resource id represents the icon resource in the source application package.

| Returns |
|---|---|
| `int` | An integer id for the badge icon resource. |

### getColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public int getColor()
```

Returns the accent color value to be used in the UI when displaying this content recommendation to the user.

| Returns |
|---|---|
| `int` | An integer value representing the accent color for this recommendation. |

### getContentImage

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public Bitmap getContentImage()
```

Returns the Bitmap containing the recommendation image.

| Returns |
|---|---|
| `https://developer.android.com/reference/android/graphics/Bitmap.html` | A Bitmap containing the recommendation image. |

### getContentIntent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public ContentRecommendation.IntentData getContentIntent()
```

Returns the data for the Intent that will be issued when the user clicks on the recommendation.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.IntentData` | An IntentData object, containing the data for the Intent that gets issued when the recommendation is clicked on. |

### getContentTypes

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String[] getContentTypes()
```

Returns an array containing the content types tags that describe the content. The first tag entry is considered the primary type for the content, and is used for content ranking purposes.

| Returns |
|---|---|
| `String[]` | An array of predefined type tags (see the `CONTENT_TYPE_*` constants) that describe the recommended content. |

### getDismissIntent

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public ContentRecommendation.IntentData getDismissIntent()
```

Returns the data for the Intent that will be issued when the recommendation gets dismissed from the Home Screen, due to an user action.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.IntentData` | An IntentData object, containing the data for the Intent that gets issued when the recommendation is dismissed from the Home Screen. |

### getGenres

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String[] getGenres()
```

Returns an array containing the genres that describe the content. Genres are open ended String tags.

| Returns |
|---|---|
| `String[]` | An array of genre tags that describe the recommended content. |

### getGroup

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String getGroup()
```

Returns the String group ID tag for this recommendation.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | A String containing the group ID tag for this recommendation. |

### getIdTag

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String getIdTag()
```

Returns the String Id tag which uniquely identifies this recommendation.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | The String Id tag for this recommendation. |

### getMaturityRating

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String getMaturityRating()
```

Returns the maturity level rating for the content.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | returns a predefined tag indicating the maturity level rating for the content (see the `CONTENT_MATURITY_*` constants). |

### getNotificationObject

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public Notification getNotificationObject(Context context)
```

Returns a `https://developer.android.com/reference/android/app/Notification.html` object which contains the content recommendation data encapsulated by this object, which can be used for posting the recommendation via the `https://developer.android.com/reference/android/app/NotificationManager.html`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` | A `https://developer.android.com/reference/android/content/Context.html` that will be used to construct the `https://developer.android.com/reference/android/app/Notification.html` object which will carry the recommendation data. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/app/Notification.html` | A `https://developer.android.com/reference/android/app/Notification.html` containing the stored recommendation data. |

### getPricingType

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String getPricingType()
```

Gets the pricing type for the content.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | A predefined tag indicating the pricing type for the content (see the `CONTENT_PRICING_*` constants). |

### getPricingValue

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String getPricingValue()
```

Gets the price value (when applicable) for the content. The value will be provided as a String containing the price in the appropriate currency for the current locale.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | A string containing a representation of the content price in the current locale and currency. |

### getPrimaryContentType

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String getPrimaryContentType()
```

Returns the primary content type tag for the recommendation, or null if no content types have been specified.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | A predefined type tag (see the `CONTENT_TYPE_*` constants) indicating the primary content type for the recommendation. |

### getProgressMax

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public int getProgressMax()
```

Returns the maximum value for the progress data of this recommendation.

| Returns |
|---|---|
| `int` | An integer representing the maximum progress value. |

### getProgressValue

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public int getProgressValue()
```

Returns the progress amount for this recommendation.

| Returns |
|---|---|
| `int` | An integer representing the recommendation progress amount. |

### getRunningTime

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public long getRunningTime()
```

Returns the running time for the content.

| Returns |
|---|---|
| `long` | The run length, in seconds, of the content associated with the notification. |

### getSortKey

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String getSortKey()
```

Returns the String sort key for this recommendation.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | A String containing the sort key for this recommendation. |

### getSourceName

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String getSourceName()
```

Returns the source application name for this recommendation.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | A String containing the recommendation source name. |

### getStatus

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public int getStatus()
```

Returns availability status value for the content. This status indicates whether the content is ready to be consumed on the device, or if the user must first purchase, rent, subscribe to, or download the content.

| Returns |
|---|---|
| `int` | The status value for the content, or -1 is a valid status has not been specified (see the `CONTENT_STATUS_*` constants for the valid status values). |

### getText

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String getText()
```

Returns the description text for this recommendation.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | A String containing the recommendation description text. |

### getTitle

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public String getTitle()
```

Returns the content title for this recommendation.

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | A String containing the recommendation content title. |

### hasProgressInfo

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public boolean hasProgressInfo()
```

Indicates if this recommendation contains valid progress information.

| Returns |
|---|---|
| `boolean` | true if the recommendation contains valid progress data, false otherwise. |

### hashCode

```
public int hashCode()
```

### isAutoDismiss

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public boolean isAutoDismiss()
```

Indicates whether this recommendation should be dismissed automatically.

Auto-dismiss notifications are automatically removed from the Home Screen when the user clicks on them.

| Returns |
|---|---|
| `boolean` | true if the recommendation is marked for auto dismissal, or false otherwise. |

### setAutoDismiss

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public void setAutoDismiss(boolean autoDismiss)
```

Sets the flag indicating if this recommendation should be dismissed automatically.

Auto-dismiss notifications are automatically removed from the Home Screen when the user clicks on them.

| Parameters |
|---|---|
| `boolean autoDismiss` | A boolean indicating if the recommendation should be auto dismissed or not. |

### setGroup

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public void setGroup(String groupTag)
```

Sets the String group ID tag for this recommendation.

Recommendations in the same group are ranked by the Home Screen together, and the sort order within a group is respected. This can be useful if the application has different sources for recommendations, like "trending", "subscriptions", and "new music" categories for YouTube, where the user can be more interested in recommendations from one group than another.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html groupTag` | A String containing the group ID tag for this recommendation. |

### setProgress

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public void setProgress(int max, int progress)
```

Sets the progress information for the content pointed to by this recommendation.

| Parameters |
|---|---|
| `int max` | The maximum value for the progress of this content. |
| `int progress` | The progress amount for this content. Must be in the range (0 - max). |

### setSortKey

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public void setSortKey(String sortKey)
```

Sets the String sort key for this recommendation.

The sort key must be a String representation of a float number between 0.0 and 1.0, and is used to indicate the relative importance (and sort order) of a single recommendation within its specified group. The recommendations will be ordered in decreasing order of importance within a given group.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html sortKey` | A String containing the sort key for this recommendation. |

### setStatus

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recommendation#1.0.0)

```
public void setStatus(@ContentRecommendation.ContentStatus int status)
```

Sets the availability status value for the content. This status indicates whether the content is ready to be consumed on the device, or if the user must first purchase, rent, subscribe to, or download the content.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/recommendation/app/ContentRecommendation.ContentStatus int status` | The status value for the content. (see the `CONTENT_STATUS_*` for the valid status values). |