1. android.os.Process.setThreadPriority (int priority)或 android.os.Process.setThreadPriority (int tid, int priority)
priority:【-20, 19】,高优先级 -> 低优先级.
2. java 方法 : java.lang.Thread.setPriority (int priority)
priority:【1, 10】,低优先级 -> 高优先级.
例子:
class LoadingThread extends Thread {public LoadingThread(){}public void run() {Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);//code here}
}