You can,t call the method onRatingChanged()when ever there is a change in rating bar..that is when you click the same rate for twice it may not change the rate bar, so the functions inside onRatingChanged() could not be invoked.Another possible way is call oncreate after every onRatingChanged() invoked..But it should not show the previous rate in the rating bar.
Update:
Suppose whatever you do inside onRatingChanged()
is wrapped into a function, processing()
. Here most probably you need is the changed rating. so we pass it as a parameter to the function. Try following way
float newRating;
myRatingBar.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
newRating=myRatingBar.getRating();
processing(newRating);
}
});