# Rating

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/Rating.java+class:androidx.media3.common.Rating)

*** ** * ** ***


```
public abstract class Rating
```

<br />

Known direct subclasses [HeartRating](https://developer.android.com/reference/androidx/media3/common/HeartRating), [PercentageRating](https://developer.android.com/reference/androidx/media3/common/PercentageRating), [StarRating](https://developer.android.com/reference/androidx/media3/common/StarRating), [ThumbRating](https://developer.android.com/reference/androidx/media3/common/ThumbRating)

|---|---|
| `https://developer.android.com/reference/androidx/media3/common/HeartRating` | A rating expressed as "heart" or "no heart". |
| `https://developer.android.com/reference/androidx/media3/common/PercentageRating` | A rating expressed as a percentage. |
| `https://developer.android.com/reference/androidx/media3/common/StarRating` | A rating expressed as a fractional number of stars. |
| `https://developer.android.com/reference/androidx/media3/common/ThumbRating` | A rating expressed as "thumbs up" or "thumbs down". |

*** ** * ** ***

A rating for media content. The style of a rating can be one of `https://developer.android.com/reference/androidx/media3/common/HeartRating`, `https://developer.android.com/reference/androidx/media3/common/PercentageRating`, `https://developer.android.com/reference/androidx/media3/common/StarRating`, or `https://developer.android.com/reference/androidx/media3/common/ThumbRating`.

## Summary

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/media3/common/Rating` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/Rating#fromBundle(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html bundle)` Restores a `Rating` from a `https://developer.android.com/reference/android/os/Bundle.html`. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/media3/common/Rating#isRated()()` Whether the rating exists or not. |
| `abstract https://developer.android.com/reference/android/os/Bundle.html` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/Rating#toBundle()()` Returns a `https://developer.android.com/reference/android/os/Bundle.html` representing the information stored in this rating. |

## Public methods

### fromBundle

```
@UnstableApi
public static Rating fromBundle(Bundle bundle)
```

Restores a `Rating` from a `https://developer.android.com/reference/android/os/Bundle.html`.

### isRated

```
public abstract boolean isRated()
```

Whether the rating exists or not.

### toBundle

```
@UnstableApi
public abstract Bundle toBundle()
```

Returns a `https://developer.android.com/reference/android/os/Bundle.html` representing the information stored in this rating.