I'm trying to convert an Xml string into a view by parsing out the
attributes into a set, and keep getting the following exception...
java.lang.ClassCastException: android.util.XmlPullAttributes
is called whenever I attempt to call Xml.asAttributeSet(XmlPullParser
parser).
Code below:
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
factory.setNamespaceAware(true);
XmlPullParser xpp = factory.newPullParser();
Log.d("ABC","**********");
xpp.setInput(new StringReader(XML_STRING));
int eventType = xpp.getEventType();
while (eventType!=XmlPullParser.END_DOCUMENT)
eventType = xpp.next();
try
{
View v = new View(this,Xml.asAttributeSet(xpp));
setContentView(v);
}
catch (Exception e)
{
Log.d("ERROR","EXCEPTION:"+e);
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---