android - Change source image for image view when pressed -
i have scroll view lots of image buttons. want change image image button when it's pressed. thing want image remain until image button pressed. that's why couldn't use selector. best practice achieve his?
best regards
you want this.
imagebutton demo_button = (imagebutton)findviewbyid(r.id.firstimage); // when click demo button demo_button.setonclicklistener(new onclicklistener() { public void onclick(view v) { demo_button.setimageresource(r.drawable.secondimage); } }
try this. (updated setset set)
Comments
Post a Comment