Parsing local xml file in android

后端 未结 4 1589
轮回少年
轮回少年 2021-01-29 00:50

Hii every one, am brand new to android,i have a doubt can any one help me

In this following link

http://www.androidpeople.com/android-xml-parsing-tutorial-using

4条回答
  •  情书的邮戳
    2021-01-29 01:00

    In the link you provided, replace the line 47

    xr.parse(new InputSource(sourceUrl.openStream()));
    

    with

    xr.parse(getResources().getAssets().open(fileName));
    

    and place your xml file in /res/raw folder

    links: Asset Manager Docs and Resources Manager Docs

提交回复
热议问题