Android Toggle image on click on the image inside listview

view full story

http://stackoverflow.com – I have a listview which has as image and a text. Bases on conditions i have set two different images for the text views. To set the images i have used viewholder.btnFavItem.setImageResource(R.drawable.imagA); Now on click i want toggle the images. if initially it was image a, i want it to becomes image b. I have used the onclick listner and not the on item click becoz i need the position of image and the textview.I need the position becoz the textview can have either of the two images.the one that has image a,i want to change that to image b. i am clicking on the image and not the tetxview (HowTos)