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

  • SEARCH
  • Home
  • 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 6041505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:40:16+00:00 2026-05-23T06:40:16+00:00

The thing is like this. I have a zip file with images that uncompressing

  • 0

The thing is like this. I have a zip file with images that uncompressing in the background (using a Thread) I start a new Activity from my main one to show these images. To show the first image I call this function on onResume:

public boolean showImage(String validFile){
    File page = new File(validFile);
    System.err.println("Attempting to show " + validFile);
    boolean found = false;
    if (page.exists()){
        System.err.println("Page exist");
        found = true;
    }
    else{           
        System.err.println("Page does not exist");
        long start = System.currentTimeMillis();
        //ProgressDialog loading = ProgressDialog.show(this, "", "Loading....",true);
        Toast.makeText(this, "Loading...", Toast.LENGTH_LONG);
        while (((System.currentTimeMillis() - start) < 5000) && (!found)){              
            if (page.exists()){
                found = true;
                //t.cancel();
                System.err.println("Page found");
            }
            else{
                System.err.println("Page does not exist");
            }
        }
    }       
    if (!found){
        return false;
    }
    else{
        System.err.println("Setting up image");
        ims.setImageDrawable(new  BitmapDrawable(BitmapFactory.decodeFile(validFile)));
        return true;
    }       
}

All I want to do is to show a Toast a progress dialog or something that says Loading… while the first image uncompresses. However neither the toast or the image are shown. Now I know the image is there for two reasons: 1 the Setting up Image and File found messages appear and I can use fling to move through the images and work just fine.

This is what happens. My activity starts and enters the code above but the first image is never shown. I fling and see the second image and the third and so forth.

So what am I doing wrong?

Thanks for any help!

  • 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-05-23T06:40:17+00:00Added an answer on May 23, 2026 at 6:40 am

    There might be another issue besides this, but the toast will not appear if you don’t call the show() method:

    Toast.makeText(this, "Loading...", Toast.LENGTH_LONG).show();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have javascript code some thing like this -- var count=3; var pl=new Array(count);
Suppose I have a doc structure like this: thing: { name: { first: John,
I have this application that need to do some things in protected paths (like
I have about 20 CSV's that all look like this: [email],[fname],[lname],[prefix],[suffix],[fax],[phone],[business],[address1],[address2],[city],[state],[zip],[setdate],[email_type],[start_code] What I've been
This is a very interesting thing. I have an APK file, com.company.app.apk. When installed
Thing is I have a file that has room for metadata. I want to
I have a controller like this: def download_link #It starts a background process to
I always forget how to do things like this. I have a database table
Think I have an integer array like this: a[0]=60; a[1]=321; a[2]=5; now I want
Hi I have a code like this, I think both the friend overloaded operator

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.