title: how to get background color of button on android?
body: <p>I want to get color of button.. I couldnt get color from getbackground function which returns drawable. I used getsolidcolor which returns integer value but its being 0 (zero) all time.. 
  I dont understand where is problem. maybe its not true function..</p>
  
  <p>here is my android code</p>
  
  <pre><code>            int renk = btn1.getSolidColor();
  
          if(renk== Color.GREEN)
              Toast.makeText(getApplicationContext(), "green" , 1000).show();
          else if(renk== Color.RED)
              Toast.makeText(getApplicationContext(), "red" , 1000).show();
          else if(renk== Color.YELLOW)
              Toast.makeText(getApplicationContext(), "yellow" , 1000).show();
          else
              Toast.makeText(getApplicationContext(), "unknown", 1000).show();
  
          btn1.setBackgroundColor(Color.YELLOW);
       renk = btn1.getSolidColor();
  
  
          if(renk== Color.GREEN)
              Toast.makeText(getApplicationContext(), "green" , 1000).show();
          else if(renk== Color.RED)
              Toast.makeText(getApplicationContext(), "red" , 1000).show();
          else if(renk== Color.YELLOW)
              Toast.makeText(getApplicationContext(), "yellow" , 1000).show();
          else
              Toast.makeText(getApplicationContext(), "unknown", 1000).show();
  </code></pre>
  
  <p>I just get unknown toast message even I set background as yellow..</p>