I have a star image in action bar. When I click on it, then the image should change to ON star. This is working fine. But how to know whether image is at ON state or OFF state.I want something that, if the image is at OFF mode and user taps on ON star, then it should set to ON star image. Initially, the image is set to OFF mode. So for this, I've wrote give line to turn on as user tap on it :
v.setBackgroundResource(android.R.drawable.star_big_on);
Guys pls suggest me for OFF mode if star image is already on. I am not getting any idea.
If my guess is correct you can achieve the functionality like this.change this code accordingly for image onclick