I want my ImageView
to change it's drawable
resource as it is pressed. The problem occurs when ImageView
is pressed for the second time.
Let me explain, if ImageView
is pressed first time, I want it to change from drawable
A to drawable
B. If ImageView
is pressed again I want it to change from drawable
B to drawable
A.
That pressed again part is not working..
Here's my code:
public void imageViewBiljeskeNaListiCheckMarkMetoda(View view){
imageViewBiljeskeNaListiCheckMark = (ImageView) findViewById(R.id.imageViewBiljeskeNaListiCheckMark);
if (view == imageViewBiljeskeNaListiCheckMark){
imageViewBiljeskeNaListiCheckMark.setImageResource(R.drawable.ic_biljeske_obavljeno);
} else {
imageViewBiljeskeNaListiCheckMark.setImageResource(R.drawable.ic_biljeske_nije_obavljeno);
}
}