title: Android Button color changing on onClick?
body: <p>I am facing a problem .</p>
  
  <p>I have two <code>Button</code> object.</p>
  
  <p><code>ButtonA</code> <code>ButtonB</code></p>
  
  <p>Requirement:-</p>
  
  <p>When ever I press <code>ButtonA</code>  the color of button should be changed and it should remain same until I clicked on <code>ButtonB</code>.</p>
  
  <p>After click on <code>ButtonB</code> same thing should be working i.e for <code>ButtonA</code></p>
  
  <pre><code>if (v == btn)
  {
      btn.setBackground(mActivity.getResources().getDrawable(R.drawable.button_color_chnager));
  }
  </code></pre>
  
  <p>XML:</p>
  
  <pre><code>&lt;item android:state_focused="true" android:state_pressed="true" 
              android:drawable="@drawable/ic_launcher" /&gt; 
  </code></pre>