Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set bitmap as drawableLeft to EditText

I am developing an app that retrieves contact image from contact database and set it to EditText as drawableLeft along with contact name

I am able to retrieve name as well as contact image as bitmap, but not able to set it as drawableLeft

like image 845
user3595649 Avatar asked Feb 14 '23 00:02

user3595649


1 Answers

Try this code:

BitmapDrawable drawableLeft = new BitmapDrawable(getResources(), yourBitmap);
mYourEditText.setCompoundDrawablesWithIntrinsicBounds(drawableLeft, null, null, null);
like image 149
erakitin Avatar answered Feb 15 '23 13:02

erakitin