Questions tagged [xmlresourceparser]

9 questions
4
votes
1 answer

Ionic Camera Attempt to invoke virtual method

We installed the Camera Plugin for Ionic and are facing this error: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a…
3
votes
2 answers

Android's XMLPullParser getAttributeValue is removing leading zeros from string

I have an XML document that contains strings with leading zeros. When I'm iterating the XML file with XmlResourceParser I have noticed that strings with leading zeros are modified removing the leading zeros when calling getAttributeValue. This…
steve
  • 303
  • 1
  • 4
  • 11
1
vote
3 answers

How can I create Drawable (or XmlResourceParser object) from XML source code provided as a string?

How can I create Drawable from XML source code provided as a string? I found the following method: Drawable drawable = Drawable.createFromXml(); But it requires to provide XmlResourceParser - and I still don't see a way to create it from XML source…
Dmitry
  • 14,306
  • 23
  • 105
  • 189
1
vote
2 answers

Why Android Studio finds error in XmlResourceParser

Simple code for parsing activity_main.xml XmlResourceParser xmlResourceParser = res.getXml(R.layout.activity_main); Android Studio finds error "Expected resource of type xml", but runs this code and app works correct.
tehnolog
  • 1,204
  • 1
  • 11
  • 23
1
vote
3 answers

XmlResourceParser.getText() returning null

I have an XmlResourceParser instance called xml. When I try to call getText() on a node, as seen in my code, it returns null. This is strange because I can call getName() on the same node it returns the proper value, so the instance is set up…
Bobby
  • 1,416
  • 1
  • 17
  • 30
0
votes
1 answer

NPE on attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData

I am trying to start the ACTION_IMAGE_CAPTURE activity from my dialog fragment and getting NPE when clicking on the relevant button to start it. I checked the manifest authorities and verified that my authority string in the fragment has …
Alon Shlider
  • 1,187
  • 1
  • 16
  • 46
0
votes
1 answer

Not able to find android.provider.CONTACTS_STRUCTURE metadata of contact apps

I am trying to get the list of contact writable accounts in my device using the following code public static final String SYNC_META_DATA = "android.content.SyncAdapter"; public static final String[] METADATA_CONTACTS_NAMES = new…
0
votes
2 answers

How do I parse and display things from an XML in an Android application?

The XML file I want to parse is Question? Answer 1 is fun Answer 2 is too Answer 3 is…
0
votes
1 answer

XmlResourceParser returns diffrent count of attributes on Lollipop

I'm playing with the new vector xml drawables on older platforms like Kitkat or Gingerbread. I have an image like this: