How can we get Drawable from appinventor

Hello all
I am new in extension building and I am building an extension.
So, basically there is a method in my extension which requires a parameter in Drawable. However in app inventor i didn't found any method to return drawable in that parameter.

If you want to use classes other than those possible in ai2, you must use the Object class.

See this:-

1 Like

Yeah that could be a way but can't we directly return drawable file in app inventor

I am not sure that there is a direct way to return a drawable. However, you can make use of this:-

@SimpleFunction
public Object GetDrawable() {
   return your_drawable;
}

or see this ImageView example:-

I think in the example of this Image View It will return the path in string format. It will just give path of file

So it seems impossible to do that with app inventor. I should have to implement a code to convert that path from string to drawable

Thanks for you help

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.