i have custom class inherits relativelayout. have imagebutton called control_btn that's defined , added layout in init() method. on ondraw, have following code (among other things):
control_btn.setimageresource(r.drawable.play_new); control_btn.getlayoutparams().width = getpixels(20); control_btn.getlayoutparams().height = getpixels(20); control_btn.setx(getpixels(0)); control_btn.sety(getpixels(10)); control_btn.setscaletype(imageview.scaletype.center_inside); control_btn.setadjustviewbounds(true); control_btn.setpadding(0, 0, 0, 0); control_btn.setbackgroundcolor(color.transparent); control_btn.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { control_btn.setimageresource(r.drawable.pause); log.d("wth", "clicked"); } }); however, image never changes, despite getting log entry. further, have imagebutton same code image change (also inside custom class).
any ideas on how fix this?
put setimageresource init() method, problem fixed.
Comments
Post a Comment