# RatingBar.OnRatingBarChangeListener

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

# RatingBar.OnRatingBarChangeListener

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/widget/RatingBar.OnRatingBarChangeListener "View this page in Kotlin")\|Java

`
public
static


interface
RatingBar.OnRatingBarChangeListener
`  
`


`

|----------------------------------------------------|
| android.widget.RatingBar.OnRatingBarChangeListener |

<br />

*** ** * ** ***

A callback that notifies clients when the rating has been changed. This includes changes that were initiated by the user through a touch gesture or arrow key/trackball as well as changes that were initiated programmatically.

## Summary

|                                                                                                                                                                            ### Public methods                                                                                                                                                                            ||
|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[onRatingChanged](https://developer.android.com/reference/android/widget/RatingBar.OnRatingBarChangeListener#onRatingChanged(android.widget.RatingBar,%20float,%20boolean))`(`[RatingBar](https://developer.android.com/reference/android/widget/RatingBar)` ratingBar, float rating, boolean fromUser) ` Notification that the rating has changed. |

## Public methods

### onRatingChanged

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void onRatingChanged (RatingBar ratingBar, 
                float rating, 
                boolean fromUser)
```

Notification that the rating has changed. Clients can use the fromUser parameter to distinguish user-initiated changes from those that occurred programmatically. This will not be called continuously while the user is dragging, only when the user finalizes a rating by lifting the touch.

<br />

|                                                                  Parameters                                                                  ||
|-------------|---------------------------------------------------------------------------------------------------------------------------------|
| `ratingBar` | `RatingBar`: The RatingBar whose rating has changed. <br />                                                                     |
| `rating`    | `float`: The current rating. This will be in the range 0..numStars. <br />                                                      |
| `fromUser`  | `boolean`: True if the rating change was initiated by a user's touch gesture or arrow key/horizontal trackbell movement. <br /> |