Access Layout or other XML Files without R.x.x

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Access Layout or other XML Files without R.x.x

Postby mrdanger » Sat Feb 13, 2010 11:22 am

Hello,

i want to read the XMLResources without the ID. I have Project Liberies, who extend my Main Project. In this Project are the int References are different.

I try this:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. InputStreamReader inReader = new InputStreamReader(
  3.  
  4. getClass().getClassLoader().getResourceAsStream("res/layout/feedback.xml"), "UTF-8");
  5.  
  6. XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
  7.  
  8. XmlPullParser xml = factory.newPullParser();
  9.  
  10. xml.setInput(inReader);
  11.  
  12. View v = new View(this, Xml.asAttributeSet(xml));
  13.  
  14.  
Parsed in 0.014 seconds, using GeSHi 1.0.8.4


cause ClassCastException : XmlPullAttributes
mrdanger
Junior Developer
Junior Developer
 
Posts: 10
Joined: Tue Jun 17, 2008 3:22 pm
Location: Hamburg, Germany

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests