Android RatingBar

Categories: Android // Tags: , .
Email this to someonePrint this pageShare on Google+1Share on Facebook0Tweet about this on TwitterShare on LinkedIn1Share on Reddit0Pin on Pinterest0Share on StumbleUpon1
  • Android RatingBar can be used to get the rating from the user. The Rating returns a floating-point number. It may be 2.0, 3.5, 4.0 etc.
  • Android RatingBar displays the rating in stars. Android RatingBar is the subclass of AbsSeekBar class.
  • The getRating() method of android RatingBar class returns the rating number.

Android RatingBar Example

The simple example of rating bar in android that will help you to know Android Ratingbar

activity_main.xml

Drag the RatingBar and Button from the pallete, now the activity_main.xml file will like this:

File: activity_main.xml

Activity class

Let’s write the code to display the rating of the user.

File: MainActivity.java

Output:

ratingoutput2

Email this to someonePrint this pageShare on Google+1Share on Facebook0Tweet about this on TwitterShare on LinkedIn1Share on Reddit0Pin on Pinterest0Share on StumbleUpon1

About Team

Browse Archived Articles by Team