Search code examples
androidratingbar

Accept a RatingBar value when the default value is selected


I have a RatingBar and it initially shows the average ratings that are entered by the users, and my problem is, the RatingBar ignores when its default value (or average) is selected. How will I fix this?


Solution

  • You can check

    if(ratingBar.getRating() == AVERAGE_RATING && ratingBar.getRating() == DEFAULT_VALUE)
    {
         // ignore
    }
    else
    {
        // Go on..
    }