Android RatingBar Example![]() 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 ExampleLet's see the simple example of rating bar in android. activity_main.xmlDrag the RatingBar and Button from the pallete, now the activity_main.xml file will like this: File: activity_main.xml
Activity classLet's write the code to display the rating of the user. File: MainActivity.java
Output:![]() ![]()
Next TopicAndroid WebView Example
|
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week