Good afternoon, I need to create a view dynamically, that is, not to transmit a link to a static xml file when creating, but dynamically, for example, passing a String in which xml is already stored for the view.
I tried to do this:
XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); XmlPullParser xpp = factory.newPullParser(); xpp.setInput(new StringReader(text)); LayoutInflater.from(context).inflate(xpp,this,true); But as written on developer.android.com:
For the construction of the XML files Therefore, it is not possible to use LayoutInflater with an XmlPullParser over a plain XML file at runtime.
Help solve this question and is it even possible?