Code example for Handler

Methods: sendEmptyMessageDelayed

0
        Log.d("Notifications", "START");
        // Toast.makeText(mContext, "Start!!!!", 
        // Constant.DEFAULT_TOAST_DISPLAY_TIME).show(); 
        final long update_interval = 20 * 1000;
        if (update_interval <= 0) return false;
        mHandler.sendEmptyMessageDelayed(ACTION_AUTO_REFRESH, update_interval);
        return true; 
        // } 
        // return false; 
    } 
 
    public void stopAutoRefresh() { 
        mHandler.removeMessages(ACTION_AUTO_REFRESH);
    } 
 
    /* 
	 *  
	 */ 
    public static boolean isRunning() { 
        return mIsRunning;
    }