Pessoal como faço para comparar se o a imagem do drawable "setada" em um ImageButton é igual a null por exemplo, ou a outra Imagem contida em outro Imagebutton?
ImageButton q1 = (ImageButton) findViewById(R.id.q1);
ImageButton q2 = (ImageButton) findViewById(R.id.q2);
ImageButton q3 = (ImageButton) findViewById(R.id.q3);
if (q1.getDrawable() != null &&
q2.getDrawable() != null &&
q3.getDrawable() != null) {
Toast.makeText(this, "Teste 1", Toast.LENGTH_SHORT).show();
if (q1.getDrawable().getConstantState().equals(q2.getDrawable().getConstantState()) &&
q2.getDrawable().getConstantState().equals(q3.getDrawable().getConstantState())) {
Toast.makeText(this, "Teste 2", Toast.LENGTH_SHORT).show();
return true;
}
}
return false;