I have been trying to create a rating bar with varying ratings and there will be many rating bars.. So I created the rating bar dynamically using java codes.. But the problem is i can't change that star image to any other image. My code is below. I tried that commented line to change picture.. but it is not working.. It's setting only one picture as like background (full length of rating bar). How can I change each stars to any other picture? Thanks in advance.
rating[i] = new RatingBar(this);
rating[i].setLayoutParams(ratingparas);
rating[i].setPadding(10, 0, 0, 0);
rating[i].setNumStars(ratingnumbr[i]);
rating[i].setStepSize((float) 1.0);
// rating[i].setProgressDrawable(getResources()
// .getDrawable(R.drawable.box));
rating[i].setTag("Ratingbar");
svhorizontal[i].addView(rating[i]);