Android boolean if not condition not working
<p>I have check against a boolean value if(!updating_questions) that is not working in my intent service in the following method</p>

<pre><code>private void sendBroadcast(Context context, String key, String value){
    //Don't broadcast if updating questions
    Util.log_debug_message("@@@@ Updating questions - " + updating_questions);
    if(!updating_questions){
        Util.log_debug_message("@@@@ Broadcasting, updating_questions = " + updating_questions);
        Broadcast.sendBroadcast(context, ResponseReceiver.ACTION_RESP, Intent.CATEGORY_DEFAULT,
                key, value);
    }
}
</code></pre>

<p>The updating_questions flag is a global private variable and it's value is false</p>

<pre><code>private boolean updating_questions = false;
</code></pre>

<p>The value is set from an extra in the onHandleIntent(Intent intent) method</p>

<pre><code>    updating_questions = intent.getBooleanExtra(AppConstants.C2DM_MESSAGE_UPDATE_QUESTIONS, false);
</code></pre>

<p>The value is set using</p>

<pre><code>    if(updating_questions){
        refreshService.putExtra(AppConstants.C2DM_MESSAGE_UPDATE_QUESTIONS, true);
    } else {
        refreshService.putExtra(AppConstants.C2DM_MESSAGE_UPDATE_QUESTIONS, false);
    }
</code></pre>

<p>This check seems to be behaing itslef properly
and the output in the console shows that the value is false but the condition is being treated as if it true</p>

<pre><code>D/QuizApp (  878): @@@@ Updating questions - false
D/QuizApp (  878): @@@@ Broadcasting, updating_questions = false
</code></pre>

<p>So if the value is false how is it possible to be broadcasting the message?
I'm obviously missing something really fundamental but haven't a clue what it is</p>
