thunderrabbit

Joel S

May 31st, 2011
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1.  
  2. XmlResourceParser parser = context.getResources().getXml(resource);
  3.  
  4. while (eventType != XmlPullParser.END_DOCUMENT) {
  5.     if (eventType == XmlPullParser.START_TAG) {
  6.  
  7.     if (parser.getName().equals("array")) {
  8.         for (int i = 0; i < parser.getAttributeCount(); i++) {
  9.  
  10.         if (parser.getAttributeName(i).equals("id")) {
  11.             if (parser.getAttributeValue(i).equals("blah")) {
  12.             Log.d(TAG,"the value of array is blah");
  13.             }
  14.         }
  15.         }
  16.     }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment