[Solved] How to set double value as rating in rating bar?
use it String ratedValue = String.valueOf(ratingBar.getRating()); rateMessage.setText(“Rating : ” + ratedValue + “/5”); 1 solved How to set double value as rating in rating bar?
use it String ratedValue = String.valueOf(ratingBar.getRating()); rateMessage.setText(“Rating : ” + ratedValue + “/5”); 1 solved How to set double value as rating in rating bar?
You need to use add the OnRatingBarChangeListener to handle the OnRatingBarChanged event. Add the necesary code to the onBindViewHolder method: @Override public void onBindViewHolder(@NonNull FoodViewHolder foodViewHolder, int i) { FoodItem currentItem = arrayList.get(i); foodViewHolder.viewHolderImageView.setImageResource(currentItem.getFoodImage()); foodViewHolder.viewHolderTextView.setText(currentItem.getFoodName()); foodViewHolder.viewHolderRatigBar.setRating(currentItem.getFoodRating()); foodViewHolder.viewHolderRatigBar.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener(){ @Override public void onRatingBarChanged(RatingBar ratingBar, float rating, boolean fromUser){ currentItem.setFoodRating(rating); } } } NOTE: The value “rating” … Read more