java - How to check image resource of an imageview programmatically? -


i want check background of imageview , sth if equals drawable in drawable folder. how can that? have try code no answer:

layoutroot.setonclicklistener(new onclicklistener() {     @override     public void onclick(view view) {         if (view.getbackground() == r.drawable.grid_single_bg_selected) {             //do sth         }     } }); 

when set background drawable set tag imageview

imageview.settag(r.drawable.demo); 

and compare

if (((integer) imageview.gettag()).intvalue == r.drawabke.demo){    // stg } 

Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

Bubble Sort Manually a Linked List in Java -

asp.net mvc - SSO between MVCForum and Umbraco7 -