Code example for AtomicBoolean

Methods: set

0
     * Creates a new asynchronous task. This constructor must be invoked on the UI thread. 
     */ 
    public MyAsyncTask() { 
        mWorker = new WorkerRunnable<Params, Result>() {
            public Result call() throws Exception { 
                mTaskInvoked.set(true);
 
                android.os.Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
                return postResult(doInBackground(mParams));
            } 
        }; 
 
        mFuture = new FutureTask<Result>(mWorker) {
            @Override 
            protected void done() { 
                try { 
                    final Result result = get();
 
                    postResultIfNotInvoked(result);
                } catch (InterruptedException e) {
                    android.util.Log.w(LOG_TAG, e);