RecommendationExtender

public final class RecommendationExtender
extends Object implements Notification.Extender

java.lang.Object
   ↳ androidx.recommendation.app.RecommendationExtender


Helper class to add content info extensions to notifications. To create a notification with content info extensions:

  1. Create an Notification.CarExtender.Builder, setting any desired properties.
  2. Create a RecommendationExtender.
  3. Set content info specific properties using the add and set methods of RecommendationExtender.
  4. Call Notification.Builder.extend(Notification.Extender) to apply the extensions to a notification.
Notification notification = new Notification.Builder(context) * ... * .extend(new RecommendationExtender() * .set*(...)) * .build(); * 

Content info extensions can be accessed on an existing notification by using the RecommendationExtender(Notification) constructor, and then using the get methods to access values.

Summary

Public constructors

RecommendationExtender()

Create a RecommendationExtender with default options.

RecommendationExtender(Notification notif)

Create a RecommendationExtender from the RecommendationExtender options of an existing Notification.

Public methods

Notification.Builder extend(Notification.Builder builder)

Apply content extensions to a notification that is being built.

String[] getContentTypes()

Returns an array containing the content types that describe the content associated with the notification.

String[] getGenres()

Returns an array containing the content genres that describe the content associated with the notification.

String getMaturityRating()

Returns the maturity level rating for the content associated with the notification.

String getPricingType()

Gets the pricing type for the content associated with the notification.

String getPricingValue()

Gets the price value (when applicable) for the content associated with a notification.

String getPrimaryContentType()

Returns the primary content type tag for the content associated with the notification.

long getRunningTime()

Returns the running time for the content associated with the notification.

int getStatus()

Returns status value for the content associated with the notification.