added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)   
belongs to Maven artifact com.android.support:recommendation:28.0.0-alpha1 Summary: [Ctors](https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#pubctors) \| [Methods](https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#inhmethods) \| [\[Expand All\]](https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#)

# RecommendationExtender

| This package is part of the Android [support library](https://developer.android.com/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](https://developer.android.com/jetpack/androidx) which is part of [Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](https://developer.android.com/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class
| mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).


`
public

final

class
RecommendationExtender
`


`

extends Object


`

`


implements

https://developer.android.com/reference/android/app/Notification.Extender.html


`

|---|---|
| java.lang.Object ||
| ↳ | android.support.app.recommendation.RecommendationExtender |

<br />

*** ** * ** ***

<br />


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

1. Create an `https://developer.android.com/reference/android/app/Notification.CarExtender.Builder.html`, setting any desired properties.
2. Create a `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender`.
3. Set content info specific properties using the `add` and `set` methods of `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender`.
4. Call `https://developer.android.com/reference/android/app/Notification.Builder.html#extend(android.app.Notification.Extender)` to apply the extensions to a notification.

```scdoc
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 ||
|---|---|
| ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#RecommendationExtender()() ` Create a `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` with default options. |
| ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#RecommendationExtender(android.app.Notification)(https://developer.android.com/reference/android/app/Notification.html notif) ` Create a `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` from the RecommendationExtender options of an existing Notification. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/app/Notification.Builder.html` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#extend(android.app.Notification.Builder)(https://developer.android.com/reference/android/app/Notification.Builder.html builder) ` Apply content extensions to a notification that is being built. |
| ` String[]` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#getContentTypes()() ` Returns an array containing the content types that describe the content associated with the notification. |
| ` String[]` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#getGenres()() ` Returns an array containing the content genres that describe the content associated with the notification. |
| ` String` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#getMaturityRating()() ` Returns the maturity level rating for the content associated with the notification. |
| ` String` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#getPricingType()() ` Gets the pricing type for the content associated with the notification. |
| ` String` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#getPricingValue()() ` Gets the price value (when applicable) for the content associated with a notification. |
| ` String` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#getPrimaryContentType()() ` Returns the primary content type tag for the content associated with the notification. |
| ` long` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#getRunningTime()() ` Returns the running time for the content associated with the notification. |
| ` int` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#getStatus()() ` Returns status value for the content associated with the notification. |
| ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setContentTypes(java.lang.String[])(String[] types) ` Sets the content types associated with the notification content. |
| ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setGenres(java.lang.String[])(String[] genres) ` Sets the content genres associated with the notification content. |
| ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setMaturityRating(java.lang.String)(String maturityRating) ` Sets the maturity level rating for the content associated with the notification. |
| ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setPricingInformation(java.lang.String, java.lang.String)(String priceType, String priceValue) ` Sets the pricing and availability information for the content associated with the notification. |
| ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setRunningTime(long)(long length) ` Sets the running time (when applicable) for the content associated with the notification. |
| ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` | ` https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setStatus(int)(int contentStatus) ` Sets the availability status for the content associated with the notification. |

| ### Inherited methods |
|---|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#)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() ` | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#)From interface ` https://developer.android.com/reference/android/app/Notification.Extender.html ` |---|---| | ` abstract https://developer.android.com/reference/android/app/Notification.Builder.html` | ` extend(https://developer.android.com/reference/android/app/Notification.Builder.html arg0) ` | ||

## Public constructors

### RecommendationExtender

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
RecommendationExtender ()
```

Create a `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` with default options.

<br />

### RecommendationExtender

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
RecommendationExtender (Notification notif)
```

Create a `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` from the RecommendationExtender options of an
existing Notification.

<br />

| Parameters ||
|---|---|
| `notif` | `Notification`: The notification from which to copy options. <br /> |

## Public methods

### extend

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
Notification.Builder extend (Notification.Builder builder)
```

Apply content extensions to a notification that is being built. This is typically called by
the `https://developer.android.com/reference/android/app/Notification.Builder.html#extend(android.app.Notification.Extender)` method of `https://developer.android.com/reference/android/app/Notification.CarExtender.Builder.html`.

<br />

| Parameters ||
|---|---|
| `builder` | `Notification.Builder` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/Notification.Builder.html` | <br /> |

### getContentTypes

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

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

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

<br />

| Returns ||
|---|---|
| `String[]` | An array of predefined type tags (see the `CONTENT_TYPE_*` constants) that describe the content associated with the notification. <br /> |

**See also:**

- `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setContentTypes(java.lang.String[])`

### getGenres

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

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

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

<br />

| Returns ||
|---|---|
| `String[]` | An array of genre tags that describe the content associated with the notification. <br /> |

**See also:**

- `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setGenres(java.lang.String[])`

### getMaturityRating

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
String getMaturityRating ()
```

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

<br />

| Returns ||
|---|---|
| `String` | returns a predefined tag indicating the maturity level rating for the content (see the `CONTENT_MATURITY_*` constants). <br /> |

**See also:**

- `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setMaturityRating(java.lang.String)`

### getPricingType

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
String getPricingType ()
```

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

<br />

| Returns ||
|---|---|
| `String` | A predefined tag indicating the pricing type for the content (see the ` CONTENT_PRICING_*` constants). <br /> |

**See also:**

- `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setPricingInformation(java.lang.String, java.lang.String)`

### getPricingValue

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
String getPricingValue ()
```

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

<br />

| Returns ||
|---|---|
| `String` | A string containing a representation of the content price in the current locale and currency. <br /> |

**See also:**

- `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setPricingInformation(java.lang.String, java.lang.String)`

### getPrimaryContentType

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
String getPrimaryContentType ()
```

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

<br />

| Returns ||
|---|---|
| `String` | A predefined type tag (see the `CONTENT_TYPE_*` constants) indicating the primary type for the content associated with the notification. <br /> |

**See also:**

- `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setContentTypes(java.lang.String[])`

### getRunningTime

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
long getRunningTime ()
```

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

<br />

| Returns ||
|---|---|
| `long` | The running time, in seconds, of the content associated with the notification. <br /> |

**See also:**

- `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setRunningTime(long)`

### getStatus

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
int getStatus ()
```

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

<br />

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

**See also:**

- `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender#setStatus(int)`

### setContentTypes

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
RecommendationExtender setContentTypes (String[] types)
```

Sets the content types associated with the notification content. The first tag entry will be
considered the primary type for the content and will be used for ranking purposes. Other
secondary type tags may be provided, if applicable, and may be used for filtering purposes.

<br />

| Parameters ||
|---|---|
| `types` | `String`: Array of predefined type tags (see the `CONTENT_TYPE_*` constants) that describe the content referred to by a notification. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` | <br /> |

### setGenres

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
RecommendationExtender setGenres (String[] genres)
```

Sets the content genres associated with the notification content. These genres may be used
for content ranking. Genres are open ended String tags.


Some examples: "comedy", "action", "dance", "electronica", "racing", etc.

<br />

| Parameters ||
|---|---|
| `genres` | `String`: Array of genre string tags that describe the content referred to by a notification. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` | <br /> |

### setMaturityRating

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
RecommendationExtender setMaturityRating (String maturityRating)
```

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

<br />

| Parameters ||
|---|---|
| `maturityRating` | `String`: A tag indicating the maturity level rating for the content. This tag must be one of the predefined maturity rating tags (see the ` CONTENT_MATURITY_*` constants). <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` | <br /> |

### setPricingInformation

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
RecommendationExtender setPricingInformation (String priceType, 
                String priceValue)
```

Sets the pricing and availability information for the content associated with the
notification. The provided information will indicate the access model for the content (free,
rental, purchase or subscription) and the price value (if not free).

<br />

| Parameters ||
|---|---|
| `priceType` | `String`: Pricing type for this content. Must be one of the predefined pricing type tags (see the `CONTENT_PRICING_*` constants). <br /> |
| `priceValue` | `String`: A string containing a representation of the content price in the current locale and currency. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` | This object for method chaining. <br /> |

### setRunningTime

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
RecommendationExtender setRunningTime (long length)
```

Sets the running time (when applicable) for the content associated with the notification.

<br />

| Parameters ||
|---|---|
| `length` | `long`: The runing time, in seconds, of the content associated with the notification. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` | <br /> |

### setStatus

added in [version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)

```
RecommendationExtender setStatus (int contentStatus)
```

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

<br />

| Parameters ||
|---|---|
| `contentStatus` | `int`: The status value for this content. Must be one of the predefined content status values (see the `CONTENT_STATUS_*` constants). <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender` | <br /> |

-

  ## Annotations

  - [ContentRecommendation.ContentMaturity](https://developer.android.com/reference/android/support/app/recommendation/ContentRecommendation.ContentMaturity)
  - [ContentRecommendation.ContentPricing](https://developer.android.com/reference/android/support/app/recommendation/ContentRecommendation.ContentPricing)
  - [ContentRecommendation.ContentStatus](https://developer.android.com/reference/android/support/app/recommendation/ContentRecommendation.ContentStatus)
  - [ContentRecommendation.ContentType](https://developer.android.com/reference/android/support/app/recommendation/ContentRecommendation.ContentType)
  - [ContentRecommendation.IntentType](https://developer.android.com/reference/android/support/app/recommendation/ContentRecommendation.IntentType)
-

  ## Classes

  - [ContentRecommendation](https://developer.android.com/reference/android/support/app/recommendation/ContentRecommendation)
  - [ContentRecommendation.Builder](https://developer.android.com/reference/android/support/app/recommendation/ContentRecommendation.Builder)
  - [ContentRecommendation.IntentData](https://developer.android.com/reference/android/support/app/recommendation/ContentRecommendation.IntentData)
  - [RecommendationExtender](https://developer.android.com/reference/android/support/app/recommendation/RecommendationExtender)