Code example for AsyncTask

Methods: cancelgetStatus

     * @param mayInterruptIfRunning <tt>true</tt> if the thread executing this 
     *        task should be interrupted; otherwise, in-progress tasks are allowed 
     *        to complete. 
    public static void cancelTask(AsyncTask<?, ?, ?> task, boolean mayInterruptIfRunning) {
        if (task != null && task.getStatus() != AsyncTask.Status.FINISHED) {
    public static class GCUtils { 
        private static final String TAG = "GCUtils";
        public static final int GC_TRY_COUNT = 2;
        // GC_TRY_LOOP_MAX is used for the hard limit of GC wait, 
        // GC_TRY_LOOP_MAX should be greater than GC_TRY_COUNT. 
        public static final int GC_TRY_LOOP_MAX = 5;
        private static final long GC_INTERVAL = DateUtils.SECOND_IN_MILLIS;
        private static GCUtils sInstance = new GCUtils();
        private int mGCTryCount = 0;
Stop searching for code, let great code find you!  Add Codota to your java IDE