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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:58:35+00:00 2026-05-15T19:58:35+00:00

I have thread in onCreate which is getting content from web. While the content

  • 0

I have thread in “onCreate” which is getting content from web. While the content is getting, I have progress dialog.

new Thread() {

     public void run() {

     Get_content() ;


    handler.sendEmptyMessage(0);
     }

     }.start();

But if I rotate the display (to landscape mode) while this is running, my application gets Force close . In the log I have this:”thread main exiting due to uncaught exception”

Here is my log:

W/dalvikvm(17144): threadid=3: thread exiting with uncaught exception (group=0x40013140)
E/AndroidRuntime(17144): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime(17144): java.lang.IllegalArgumentException: View not attached to window manager
E/AndroidRuntime(17144): at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:356)
E/AndroidRuntime(17144): at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:201)
E/AndroidRuntime(17144): at android.view.Window$LocalWindowManager.removeView(Window.java:400)
E/AndroidRuntime(17144): at android.app.Dialog.dismissDialog(Dialog.java:268)
E/AndroidRuntime(17144): at android.app.Dialog.access$000(Dialog.java:69)
E/AndroidRuntime(17144): at android.app.Dialog$1.run(Dialog.java:103)
E/AndroidRuntime(17144): at android.app.Dialog.dismiss(Dialog.java:252)
E/AndroidRuntime(17144): at com.webservice.KursnaLista$1.handleMessage(KursnaLista.java:77)
E/AndroidRuntime(17144): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(17144): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(17144): at android.app.ActivityThread.main(ActivityThread.java:3948)
E/AndroidRuntime(17144): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(17144): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(17144): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
E/AndroidRuntime(17144): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
E/AndroidRuntime(17144): at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm(17144): threadid=7: reacting to signal 3
I/ActivityManager( 59): Process com.webservice (pid 17144) has died.

  • 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-15T19:58:36+00:00Added an answer on May 15, 2026 at 7:58 pm

    What is happening is on orientation change, the activity is killed and re-created. But since you started a thread and the thread is still running, it is not killed, and when it finishes and tries to close the Progress Dialog, that causes the FC because the progress dialog doesn’t exist. This is a pretty common problem, you can check out the droid-fu library that tries to fix this, or you can be smarter with your Threaded task (like if it is going to take a decent amount of time to complete, then maybe put it in a background service).

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

Sidebar

Ask A Question

Stats

  • Questions 448k
  • Answers 448k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The best bet: Example of how to use Visual Studio… May 15, 2026 at 7:59 pm
  • Editorial Team
    Editorial Team added an answer Here's a recent dev blog post that steps you through… May 15, 2026 at 7:59 pm
  • Editorial Team
    Editorial Team added an answer Why not turn it around? class MyHTTPRequest { public string… May 15, 2026 at 7:59 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.