Back to project page webimageloader.
The source code is released under:
Apache License
If you think the Android project webimageloader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.webimageloader.util; /* w w w. j a v a 2s . c om*/ import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; import android.os.Process; public class PriorityThreadFactory implements ThreadFactory { private String name; private int priority; private AtomicInteger count = new AtomicInteger(1); public PriorityThreadFactory(String name, int priority) { this.name = name; this.priority = priority; } @Override public Thread newThread(Runnable r) { return new Thread(r, name + " #" + count.getAndIncrement()) { @Override public void run() { Process.setThreadPriority(priority); super.run(); } }; } }