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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:55:14+00:00 2026-05-20T03:55:14+00:00

I have a tab layout app that needs to download a few files right

  • 0

I have a tab layout app that needs to download a few files right when it starts, so in the Main.java file in the onCreate method I call:

  myProgressDialog = ProgressDialog.show(Controller.this,
                "Please wait...", "Doing Extreme Calculations...", true);
    downloadFile(NAME_LOCAL, NAME_SERVER, true);

downloadFile is a separate thread it looks likes this:

 protected void downloadFile(final String localFilePath, final String remoteFileName, final boolean ASCII) {

            // Fire off a thread to do some work that we shouldn't do directly in the UI thread

            Thread a = new Thread() {
                public void run() {


                    Logger.setLevel(Level.DEBUG); 


                        try{
                            //create client
                            log.info("Creating Client");
                            ftp = new FileTransferClient();
                            log.info("Setting Remote Host");
                            ftp.setRemoteHost(host);
                            ftp.setUserName(username);
                            ftp.setPassword(password);
                            //connect. . .We hope
                            log.info("Connecting to server " + host);
                            ftp.connect();
                            ftp.getAdvancedFTPSettings().setConnectMode(FTPConnectMode.PASV);
                            if(ASCII){
                            ftp.setContentType(FTPTransferType.ASCII);
                            Log.d("ASCII", "USING ASCII");
                            }else if(!ASCII){
                                Log.d("BINARY", "USING BINARY");
                                ftp.setContentType(FTPTransferType.BINARY);

                            }

                            ftp.downloadFile(cache + localFilePath , remoteFileName);

                        }catch (Exception e){
                            e.printStackTrace();

                        }





                    mHandler.post(mUpdateResults);
                    Handler handler=new Handler();
                    handler.post(new Runnable(){public void run(){myProgressDialog.dismiss();}});

                }
            };
            a.start();

        }

In log cat it starts the download, and it finishes then all the sudden it gives me this:

02-17 17:27:51.175: ERROR/WindowManager(2523): Activity org.IRE.toolbox.Controller has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@46eba2f0 that was originally added here

02-17 17:27:51.175: ERROR/WindowManager(2523): android.view.WindowLeaked: Activity org.IRE.toolbox.Controller has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@46eba2f0 that was originally added here

Whats going on?!
Thanks in advance!

  • 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-20T03:55:15+00:00Added an answer on May 20, 2026 at 3:55 am

    The code posted is going to raise an exception in the Thread.run() at:

    Handler handler=new Handler();
    

    The reason is that the thread has not called Looper.prepare. You probably saw a “Force Close” prompt and if you dig through your logs, you’ll probably find something like:

    ERROR/AndroidRuntime(1161): Uncaught handler: thread Thread-9 exiting due to uncaught exception
    ERROR/AndroidRuntime(1161): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
    ERROR/AndroidRuntime(1161):     at android.os.Handler.<init>(Handler.java:121)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tab page that should be hidden if a property (BlahType) is
I have a tab delimited file where each record has a timestamp field in
Modern browsers have multi-tab interface, but JavaScript function window.showModalDialog() creates a modal dialog that
So I have a form with lots of controls that all have a tab
I have a huge tab separated file which I want to sort on its
I have to parse a tab-delimited text file with Ruby to extract some data
I have a Facebook application that has a user profile tab. The specs of
I currently have a tab layout with 2 tabs, one tab with a list
Facebook apps are allowed to have a tab that a user can add to
I have a Tab Control with multiple Tab Pages. I want to be able

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.