int img = R.drawable.smiley; editText.setCompoundDrawables( null, null, img, null );
Explained here
setCompoundDrawablesWithIntrinsicBounds (int left, int top, int right, int bottom)
Sets Drawables (if any) to appear to the left of, above, to the right of the text and below it. Use 0 if you don't need Drawable. Borders Drawables will be set to their inner borders.
Renjith Krishnan Mar 10 '14 at 10:09 2014-03-10 10:09
source share