Code example for AtomicBoolean

Methods: get

0
            } 
        }; 
    } 
 
    private void postResultIfNotInvoked(Result result) {
        final boolean wasTaskInvoked = mTaskInvoked.get();
        if (!wasTaskInvoked) {
            postResult(result);
        } 
    } 
 
    private Result postResult(Result result) {
        @SuppressWarnings("unchecked") 
        Message message = sHandler.obtainMessage(MESSAGE_POST_RESULT,
                new AsyncTaskResult<Result>(this, result));
        message.sendToTarget();
        return result;
    } 
 
    /** 
     * Returns the current status of this task.