How to start a new Thread in a service?

前端 未结 4 1525
甜味超标
甜味超标 2020-12-12 20:08

I am developing an Android app and I am doing some heavy work (bringing data from an online web page and parsing it to store in database) in a service. Currently, it is taki

4条回答
  •  执念已碎
    2020-12-12 21:10

    Android commandment: thou shall not interact with UI objects from your own threads

    Wrap your Toast Display into runOnUIThread(new Runnable() { });

提交回复
热议问题