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

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -