Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a drawable from a created imageview

Tags:

android

I'm trying to create a drawable from an ImageView I know that we can do that with getressources :

Drawable drawable = getResources().getDrawable(imageview.getId());

But my imageview is created programmatically, I can not get the ID even with the getID() method.

like image 574
Anass Avatar asked Jan 18 '23 22:01

Anass


1 Answers

if you can access to the ImageView you cam simply call getDrawable() to get its drawable

like image 171
romy_ngo Avatar answered Jan 21 '23 12:01

romy_ngo