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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:39:59+00:00 2026-06-05T19:39:59+00:00

When my app launches a file scraper that iterates recursively through the sdcard is

  • 0

When my app launches a file scraper that iterates recursively through the sdcard is kicked off. As you can imagine, this takes a fair amount of time. On my epad transformer it can take 30 to 40 seconds to blitz through the 32gb of storage.

This activity is done in two fragments that live on the main layout, launched from the main activity.

Obviously with load times like that I need to do something to alert the user. However, from what I’ve read I can’t launch the main activity in the background behind a load screen. I’ve tried to drop a progress bar on and also failed.

So, any suggestions?

EDIT

I’m just reading up on using an aSyncTask within a fragment. I would love to use a progressbar, either within the slow list fragment, or on a splashscreen, or just over the main view

  • 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-05T19:40:00+00:00Added an answer on June 5, 2026 at 7:40 pm

    Do something like this

    LoadTask load;
    
    public class LoadTask extends AsyncTask<Void, Integer, Boolean> {
    
            int prog = 0;
    
            @Override
            protected Boolean doInBackground(Void... params) {
    
                //All your loading code goes in here 
    
                publishProgress(prog++); //Use this to update the progress bar
    
                publishProgress(-1) //Use this to open other app
                return false;
            }
    
            protected void onProgressUpdate(Integer... progress) {
                 if(progress[i] == -1)
                     //open other app here
    
                 for(int i = 0; i < progress; i++){
                      //set progress here with progress[i];
                 }
            }
    
    
    }
    

    then to start the async task use

    load = new LoadTask();
    load.execute();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My android app needs to write a file to a location that can be
Client wants a button on the mobile web app that launches a QR code
My app checks if an NSString is empty when it launches, like this: if
I have a button that launches the google maps app on my device via
I have an .xml file that is going to be shipped within my app.
I am having a Default.png file in my project, so that whenever my app
I have an app that launches a browser with a VIEW intent pointing at
I have an App (Mini file manager) on my phone that has a button
I have an app that can launch in portrait or landscape. I'd like the
I have a simple JNLP file that launches a Hello World command line application.

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.