sivaraj sivaraj - 1 year ago 106
Android Question

How can I add an image on EditText

I want to dynamically add image in

. Is it possible?

if anyone knows please give sample code for that.

Answer Source

If something like this:


is what you're talking about, then you just need to either set the Drawable{Right | Left | Top | Bottom} property in the xml, or call the corresponding java command.

EditText text = (EditText)findViewById(;
text.setCompoundDrawables(null, null, getResources().getDrawable(R.drawable.check_box), null);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download