It seems that I was able to answer my own question.
As this is an extension of the progress bar, I´m guessing that when I change the number of stars, a progress bar is stretching to the new width, but keeping it's original values, not reflecting the portion that must fill. By using setMax for the Rating Bar, I think I´m setting the new limits for this bar, so, I changed the number of stars and set the max value to that number, like this:
RatingBar rb = (RatingBar) view.findViewById(rbars[r]);
rb.setNumStars(Integer.valueOf(SP.getString(rchars[r], "3")));
rb.setMax(Integer.valueOf(SP.getString(rchars[r],"3")));
rb.setRating(2);
In this way the rating coincide with the filled stars.