title: RatingBar set selector programmatically
body: <p>In my Custom Ratingbar class I want to set its selector programatically. </p>
  
  <p>This works and change the color states.</p>
  
  <pre><code> LayerDrawable stars = (LayerDrawable) getProgressDrawable();
      stars.getDrawable(2).setColorFilter(Color.parseColor("#62CFDE"),
              PorterDuff.Mode.SRC_ATOP); // for filled stars
      stars.getDrawable(1).setColorFilter(Color.parseColor("#FFFFFF"),
              PorterDuff.Mode.SRC_ATOP); // for half filled stars
      stars.getDrawable(0).setColorFilter(Color.parseColor("#62CFDE"),
              PorterDuff.Mode.SRC_ATOP); // for empty stars
  </code></pre>
  
  <p>But I want to set images in selector, but this code is not working. </p>
  
  <pre><code> StateListDrawable states = new StateListDrawable();
      states.addState(new int[]{android.R.attr.progressDrawable}, selectedImage);
      states.addState(new int[]{android.R.attr.progress}, selectedImage);
      states.addState(new int[]{android.R.attr.secondaryProgress}, backgroundImage);
      states.addState(new int[]{android.R.attr.background}, backgroundImage);
      setBackground(states);
  </code></pre>
  
  <p>Please suggest me how can I set the selector of my Ratingbar programatically. </p>