Share via


Rating.NewStarRating(RatingStyle, Single) Method

Definition

Return a Rating instance with a star-based rating.

[Android.Runtime.Register("newStarRating", "(IF)Landroid/media/Rating;", "")]
public static Android.Media.Rating? NewStarRating (Android.Media.RatingStyle starRatingStyle, float starRating);
[<Android.Runtime.Register("newStarRating", "(IF)Landroid/media/Rating;", "")>]
static member NewStarRating : Android.Media.RatingStyle * single -> Android.Media.Rating

Parameters

starRatingStyle
RatingStyle

one of #RATING_3_STARS, #RATING_4_STARS, #RATING_5_STARS.

starRating
Single

a number ranging from 0.0f to 3.0f, 4.0f or 5.0f according to the rating style.

Returns

null if the rating style is invalid, or the rating is out of range, a new Rating instance otherwise.

Attributes

Remarks

Return a Rating instance with a star-based rating. Create and return a new Rating instance with one of the star-base rating styles and the given integer or fractional number of stars. Non integer values can for instance be used to represent an average rating value, which might not be an integer number of stars.

Java documentation for android.media.Rating.newStarRating(int, float).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to