Создать экземпляр EditText
EditText editText = (EditText) findViewById(R.id.EditText1);
Затем создайте нарисованный экземпляр изображения
Drawable image = getResources().getDrawable(R.drawable.ic_warning); // API 21 and below.
OR
Drawable image = getDrawable(R.drawable.ic_warning); // API 22 and above.
Затем установите изображение, позвонив setCompoundDrawablesWithIntrinsicBounds(Drawable left, Drawable top, Drawable right, Drawable bottom);
editText.setCompoundDrawablesWithIntrinsicBounds(null, null, image, null);
Приведенная выше строка установит изображение в правой части EditText