So I'm trying to set the rating of the RatingBar (RB) widget in code during a touch event. Basically, when a user clicks the RB, it has to do some background stuff and then the value of the RB should obviously display the new value.

Okay let me also state that I'm using the RB as a "favourite" button. It's probably not the best thing to use but that doesn't mean I can't, right?

The RB consists of only 1 star. And if a user clicks it, it adds an item to the favourites list and highlights the star. When the user clicks it again, sure enough, the item is removed from the favourites list but the RB does not reset to 0.

```
favourite_button.setOnTouchListener (new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
  if (event.getAction() == MotionEvent.ACTION_UP) {
    if (_favourited) {
      // do stuff
      favourite_button.setRating(0);
      _favourited = false;
    } else {
      // do stuff
      favourite_button.setRating(1);
      _favourited = true;
    }
  }
  return false;
}});

```

My code works, and it works well, I just can't see why "unfavouriting" doesn't change the RB back to 0.

So what could be the problem? When I use "setRating(0)" in a setOnRatingBarChangeListener it sure enough sets the rating to 0. But I can't use the setOnRatingBarChangeListener of the RB because one can't "touch" zero stars.

how to set it back to 0 when clicked again?