Vector Drawable

I am trying to create extension, and i found this line of code:

playButton.setImageResource(R.drawable.play);

so i need to get play from drawable res and set i to my assets
but i found play as xml file

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:height="32dp"
    android:width="32dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path android:fillColor="#FFF" android:pathData="M8,5.14V19.14L19,12.14L8,5.14Z" />
</vector>

so i need to know how to convert this xml code to image or Drawable to use it
to set it in playButton

playButton.setImageDrawable(playDrawable);

sorry my language is weak

Well, you cannot do that in AppInventor.

thanks for reply me.
i can't convert this xml to image too? like to be .png or jpeg or something like that?

You could in theory, but I'm not sure how.

Vectors are basically SVGs for Android, if you are able to get them to SVG format, then you can.

1 Like

Thanks,
I found web site convert xml vector drawable to svg

Just import: from xml file
Untitled
Then export: to SVG
Untitled2


then go to web site to convert svg to png or any image format
like

That is my way :smiley:
thanks @Kumaraswamy :heart:

1 Like

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