Most visited

Recently visited

Added in API level 1

RatingBar.OnRatingBarChangeListener

public static interface RatingBar.OnRatingBarChangeListener

android.widget.RatingBar.OnRatingBarChangeListener


当评级已更改时通知客户的回调。 这包括用户通过触摸手势或箭头键/轨迹球发起的更改以及以编程方式启动的更改。

Summary

Public methods

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

通知,评级已更改。

Public methods

onRatingChanged

Added in API level 1
void onRatingChanged (RatingBar ratingBar, 
                float rating, 
                boolean fromUser)

通知,评级已更改。 客户端可以使用fromUser参数来区分用户发起的更改和编程发生的更改。 只有当用户通过抬起触摸来完成评定时,才会在用户拖动时连续调用此方法。

Parameters
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.

Hooray!