title: Setting background colour on check box in android
body: <p>I'm trying to set the background colour of a check box when it has been checked then and if it is unchecked then to remove that colour.</p>
  
  <p>Can anybody help me find the Id of the checkbox then to check if it is checked. I have set in my XML sheet <code>android:onClick="handleCheckBoxClick"</code></p>
  
  <p>For you to get an idea of how it looks I have roughly 25 check boxes.
  which I need the same doing to them when they are pressed.</p>
  
  <p>Is it possible to have one block of code or would it need to be repeated for each checkbox?</p>
  
  <p>EDIT:
  Forgot to mention this is within a fragment (if that makes any difference)</p>
  
  <pre><code>public void handleCheckBoxClick(View view) {
          int chkID = view.getId();
  
          if (){
  
          }else{
  
          }
  
          //find which checkbox was checked then get its id
          /*
           * if checked then
           * change background colour to blue
           * if unchecked then
           * remove background colour
           * 
           */
      }
  </code></pre>
  
  <p>The colour part i'll try myself as do need to learn .</p>