如何在Android中设置IntentService优先
问题描述:
我想知道是否可以设置一个 IntentService
的优先级一样,你可以用发
。到目前为止,我没有发现任何东西。
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.
答
在 HandlerThread
的 IntentService
使用不暴露于SDK。它被设置为 Process.THREAD_PRIORITY_DEFAULT
作为工作重点。
The HandlerThread
that IntentService
uses is not exposed to the SDK. It is set to Process.THREAD_PRIORITY_DEFAULT
as a priority.
注意 IntentService
143线code,包括空格和注释,所以你可能考虑只克隆它有一个与你所寻求的优先级。
Note that IntentService
is 143 lines of code, including whitespace and comments, so you might consider just cloning it to have one with the priority you seek.