android-How to run Service in different thread than main thread?

前端 未结 5 1095
攒了一身酷
攒了一身酷 2021-02-18 14:29

I am trying to develop a application in android that consists a service to read the sensor value for multiple hours. When i start the service my device get hang and all the othe

5条回答
  •  -上瘾入骨i
    2021-02-18 14:38

    you can try using AsyncTask, please read this documentation.

    http://developer.android.com/reference/android/os/AsyncTask.html

提交回复
热议问题