title: Android java change drawable image
body: <p>Alright so how when i click a button? it will change the a image to a different image</p>
  
  <p>my xml of the image i want to change when button press:    </p>
  
  <pre><code>&lt;ImageView
      android:id="@+id/bluebtn1" 
      android:src="@drawable/buttonblue" 
      android:layout_width="60dp" 
      android:layout_height="60dp"  
      android:layout_marginLeft="33dp"
      android:layout_marginTop="140dp"&gt;&lt;/ImageView&gt;
  </code></pre>
  
  <p>and here is my java code ill be doing when you press the button</p>
  
  <pre><code>    case R.id.redbtn1:
              if (lvl1.getText().equals("1")) {
                  lvl1.setText("2");
  
  // Here is where the code goes to change the image
  
              } else {
                  Toast.makeText(main.this, "YOU LOSE!", Toast.LENGTH_SHORT).show();
              }
          break;
  </code></pre>