I have a string that represents a svg.
<svg height="210" width="400"><path d="M150 0 L75 200 L225 200 Z" />
How can I turn this string into a Drawable, Bitmap or similar to display it in an imageview?
I have a string that represents a svg.
<svg height="210" width="400"><path d="M150 0 L75 200 L225 200 Z" />
How can I turn this string into a Drawable, Bitmap or similar to display it in an imageview?
There are a few SVG libraries for Android you can choose. Each will do it slightly differently.
For AndroidSVG, you would do it like this:
SVG svg = SVG.getFromString(myStringWithSvgInIt);
PictureDrawable pd = new PictureDrawable(svg.renderToPicture());
myImageView.setImageDrawable(pd);