Java tutorial
//package com.java2s; import android.annotation.SuppressLint; import android.os.Build; import java.util.concurrent.ThreadPoolExecutor; public class Main { @SuppressLint("NewApi") public static void allowCoreThreadTimeout(ThreadPoolExecutor executor, boolean value) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { executor.allowCoreThreadTimeOut(value); } } }