start async task from onhandleintent

前端 未结 3 2059
感动是毒
感动是毒 2020-12-11 20:28

Should we start async task from within onHandleIntent() method of IntentService? I read that onHandleIntent() runs in worker thr

3条回答
  •  轮回少年
    2020-12-11 21:16

    AsyncTask class is used to provide a mechanism to do achieve multithreading, so your event thread wont get hanged, but as you are using service, you should not use, AsyncTask in the Service, instead you can use, threads, if some long running task is to executed, in the Service.

提交回复
热议问题