请帮忙,如何进行后台资源检查?
示例:
Button button1;
protected void onCreate(Bundle savedInstanceState) {
..........................................
button1 = (Button) findViewById(R.id.example1);
}
public void onclick1 (View v){
button1.setBackgroundResource(R.drawable.example2);
}
public void onclick2 (View v){
我有个问题,想要检查 button1 按钮的 drawable 是否为 example2
if (..........................){
//Action
}
如果没有被点击,将执行另一个操作。
else {
//Another Action
}
}