Code example for ScheduledExecutorService

Methods: submit

0
        } 
    } 
 
    /* package */ synchronized void flush() { 
        removeAnyScheduledFlush(); 
        mExecutor.submit(mFlushCallable);
    } 
 
    private final Callable<Object> mFlushCallable = new Callable<Object>() {
        @Override 
        public Object call() throws Exception { 
            if (mJsonWriter != null) mJsonWriter.flush(); 
            return null; 
        } 
    }; 
 
    private ScheduledFuture<Object> mFlushFuture;
 
    private void removeAnyScheduledFlush() { 
        if (mFlushFuture != null) {
            mFlushFuture.cancel(false);