How to set Priority of IntentService in Android

前端 未结 4 1290
再見小時候
再見小時候 2021-01-05 06:41

I was wondering if it is possible to set the priority of an IntentService like you can with a Thread. So far I have not found anything.

4条回答
  •  青春惊慌失措
    2021-01-05 07:44

    Just to make it clear - by default IntentService priority is default- Process.THREAD_PRIORITY_DEFAULT because it uses HandlerThread Internally. You can use Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND) in OnHandleIntent(), or whatever the CommonsWare suggested in the answer.

    some people raised this as bug. and there is also patch available for this.

提交回复
热议问题