Skip to content

Most visited

Recently visited

added in API level 1


public static interface RatingBar.OnRatingBarChangeListener


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.


Public methods

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

Notification that the rating has changed.

Public methods


added in API level 1
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.

ratingBar RatingBar: The RatingBar whose rating has changed.

rating float: The current rating. This will be in the range 0..numStars.

fromUser boolean: True if the rating change was initiated by a user's touch gesture or arrow key/horizontal trackbell movement.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)