code: public static Drawable createFromXml(Resources r, XmlPullParser parser, Resources.Theme theme) throws XmlPullParserException, IOException {
          AttributeSet attrs = Xml.asAttributeSet(parser);
  
          int type;
          while ((type = parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) {
              // Empty loop
          }
  
          if (type != XmlPullParser.START_TAG) {
              throw new XmlPullParserException("No start tag found");
          }
  
          Drawable drawable = createFromXmlInner(r, parser, attrs, theme);
  
          if (drawable == null) {
              throw new RuntimeException("Unknown initial tag: " + parser.getName());
          }
  
          return drawable;
      }
docs: Create a drawable from an XML document using an optional {@link Resources.Theme}. For more
  information on how to create resources in XML, see
  <a href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.