How to solve the XML parsing performance issue on Android

后端 未结 8 1914
耶瑟儿~
耶瑟儿~ 2020-12-25 08:31

I have to read a XML file with about ~4000 lines on Android. First I tried the SimpleXML library because it\'s the easiest and it took about 2 minutes on my HTC Desire. So I

8条回答
  •  余生分开走
    2020-12-25 09:02

    Rather than making it a synchronous process, make it asynchronous. You can have a button that starts an IntentService which will process the data for you and will update the results and show a notification when it is done. That way you don't stop the UI thread.

提交回复
热议问题