title: Android: Checking Background Resource Drawable
body: <p>Please help how can we do a Background Resource Check?</p>
  
  <p>Example:</p>
  
  <pre><code>  Button button1;
  
    protected void onCreate(Bundle savedInstanceState) {
    ..........................................
    button1 = (Button) findViewById(R.id.example1);
    }
  
    public void onclick1 (View v){
           button1.setBackgroundResource(R.drawable.example2);
    }
  
    public void onclick2 (View v){
  </code></pre>
  
  <p>My Question Here, checking if button1 button drawable = example2</p>
  
  <pre><code>        if (..........................){
                 //Action
          }
  </code></pre>
  
  <p>If not, when clicked will done another action</p>
  
  <pre><code>        else {
                 //Another Action
          }
     }
  </code></pre>