title: How to change drawable in an ImageView based on radioButton selection in my android app
body: <p>I am looking for a way to change the drawable image source based on radio button selection.</p>
  
  <p>Imageview displays image 1
  radio button 1 selected</p>
  
  <p>if radio button 2 selected
  imageview displays image 2</p>
  
  <p>etc...</p>
  
  <p>any suggestions would be most appreciated.</p>
  
  <p>Thank you
  this is what i have in the java file:</p>
  
  <pre><code>    private OnClickListener rollRightlistener = new OnClickListener() {
          public void onClick(View v) {
              roll_left.setChecked(false);
              roll_right.setChecked(true);
              ImageView i = (ImageView) findViewById(R.id.rol_off_45_mainimage);
              i.setImageResource(R.drawable.cube_rolling_45_right);
          }
      };
  </code></pre>
  
  <p>getting multiple markers at this line error where you see ImageView i = and also ImageView cannot be resolved to a type. </p>
  
  <p>any suggestions would be great</p>