Skip to content
Snippets Groups Projects
Commit c0e1bef0 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Use application threadpool in image loader

parent f8a17fac
No related branches found
No related tags found
No related merge requests found
......@@ -34,9 +34,6 @@ import org.videolan.vlc.BR;
import org.videolan.vlc.VLCApplication;
import java.util.concurrent.Callable;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class AsyncImageLoader {
......@@ -47,12 +44,8 @@ public class AsyncImageLoader {
public final static String TAG = "VLC/AsyncImageLoader";
/* Maximum one thread that is killed after 2 seconds of inactivity */
static ThreadPoolExecutor sThreadPool = new ThreadPoolExecutor(0, 1, 2, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>());
public static void LoadImage(final Callbacks cbs, final View target){
sThreadPool.execute(new Runnable() {
VLCApplication.runBackground(new Runnable() {
@Override
public void run() {
final Bitmap bitmap = cbs.getImage();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment