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
Post a Comment