title: How to check if the view is set the specific background
body: <p>i am trying to compare the view background to the drawable but its not working for me.</p>
  
  <pre><code>View v1 = options.findViewById(i);
  v1.findViewById(R.drawable.back);
  Drawable d = v1.getBackground();       
  
  if(d.getConstantState() == getResources().getDrawable(R.drawable.correct_ans_back)){
      v1.setBackgroundResource(R.drawable.a);             
  }else{
      view.setBackgroundResource(R.drawable.b);               
  }
  </code></pre>
  
  <p>how to check i am getting an error here.</p>
  
  <pre><code>incompatible operand types Drawable.Constant State and Drawable
  </code></pre>