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 7902435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:29:36+00:00 2026-06-03T09:29:36+00:00

After reading some statistics about my app I saw that it takes over one

  • 0

After reading some statistics about my app I saw that it takes over one month to update 75% of my users. Since all updates are very important I’ve come up to make an in-app alert that tells users that there is an update pending.

There is a text file containing the actual app version (18), stored in a webserver which is gotten by the DownloadText() method. This number goes in isUpdatetxt and is extracted from non-displayable characters with .substring(1, 3). So basically, there’s only “18” left.

But there is my problem: isUpdatetxt == "18" returns false, when it’s not supposed to.

private class GetUpdate extends AsyncTask<Void, Void, Void>
{

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        Toast.makeText(getApplicationContext(), "Vérification de mise à jours", Toast.LENGTH_LONG).show();
    }

    @Override
    protected void onPostExecute(Void result) {

        /** For debug reference*/
        Toast.makeText(getApplicationContext(), "*" + isUpdatetxt + "*" + " " + (isUpdatetxt.length()), Toast.LENGTH_LONG).show(); 
        if(isUpdatetxt == "18"){
            alertDialog.show();
        }
    }

    @Override
    protected Void doInBackground(Void... params) {
        isUpdatetxt = DownloadText(updateURL);
        isUpdatetxt = isUpdatetxt.substring(1, 3);
        return null;
    }

}
  • 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-03T09:29:37+00:00Added an answer on June 3, 2026 at 9:29 am

    If you are comparing Strings in Java, you should be using .equals().

    When you compare strings with == in Java, you compare the references.

    So your if-statement will be something like:

    if(isUpdatetxt.equals("18")){
        alertDialog.show();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After reading some posts like this one: Choose File Dialog It appears that Android
After reading some stuffs about the managed and unmanaged code,i realized that in managed
After reading some tutorials I came to the conclusion that one should always use
After reading some articles about XSS I have incorporated HTMLPurifier into my zend framework
I came across couple of questions about OCL expressions. After reading some university slides
After some reading and R&D, I have came to conclusion that ? Forms in
I'm learning about software engineering and design right now, and after reading some books
After reading some tutorials I am still unclear on some points about memory management
I'm learning about multithreading, but after reading some tutorials I'm sort of confused. I
I'm developing my own project using spring-mvc and spring-webflow. After reading some articles about

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.