How to reading XML from a URL in Android

后端 未结 3 593
心在旅途
心在旅途 2021-01-21 09:58

I want to read a XML document from a URL:

public void DownloadXmlFile() throws IOException{
        //TODO
        String url = \"http://api.m1858.com/coursebook         


        
3条回答
  •  忘掉有多难
    2021-01-21 10:53

    This is not an XML Problem its a Strict Mode Problem. You should'nt do time intensiv things in Gui Thread, do it in a own Thread.

    • Blogpost with introduction
    • Developers API infos
    • BestPracties

    However, you can disable it, but you shouldt ;) see here

提交回复
热议问题