Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7911551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:17:22+00:00 2026-06-03T13:17:22+00:00

I have check against a boolean value if(!updating_questions) that is not working in my

  • 0

I have check against a boolean value if(!updating_questions) that is not working in my intent service in the following method

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);
    }
}

The updating_questions flag is a global private variable and it’s value is false

private boolean updating_questions = false;

The value is set from an extra in the onHandleIntent(Intent intent) method

    updating_questions = intent.getBooleanExtra(AppConstants.C2DM_MESSAGE_UPDATE_QUESTIONS, false);

The value is set using

    if(updating_questions){
        refreshService.putExtra(AppConstants.C2DM_MESSAGE_UPDATE_QUESTIONS, true);
    } else {
        refreshService.putExtra(AppConstants.C2DM_MESSAGE_UPDATE_QUESTIONS, false);
    }

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

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

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:17:25+00:00Added an answer on June 3, 2026 at 1:17 pm

    Your if condition is:

    !updating_questions
    

    This means that do this block if updating_questions is NOT true(see the ! operator).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom validator method that will check an inputted zip code against
I have a bunch of numbers timestamps that I want to check against a
I have a list of values that i need to check against a constant
In my controller class I have the following line of check against my model.
I have a password box that I am going to check against a Regex
I have an existing python script that, among other things checks a file against
I have a check box list in that user can check or uncheck the
I have a check box, RequiredFieldValidator and textbox that have editmask extender I want
I have to check a users input against their in-putted email to check if
I have a list of values I have to check my input against it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.