Android: Loading Local Asset XML as URL-Collection of common programming errors
I’m playing around with a custom listview using this tutorial:
http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/
I’m running into an issue though with trying to modify it. If I want to use local android_assets instead of an XML file loaded from a web link, my app crashes. What I’m doing is changing this line:
static final String URL = "http://api.androidhive.info/music/music.xml";
to this:
static final String URL = "file:///android_asset/music.xml";
but when I do this, my app crashes on this line:
String xml = parser.getXmlFromUrl(URL); // getting XML from URL
Any help would be awesome. Thank you!