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

Related Questions

I have a method which I am calling from onCreate( main thread). Inside the
I have a thread which needs to be run in the background every 1000ms.
I have a Service which starts a thread during onCreate() . The thread is
I have one thread class which star in onCreate of an activity. class MyThread
I have an app in android that in a different thread from the UI(which
I have a ContentProvider named GeneralDataProvider . Which calls @Override public boolean onCreate() {
I have a thread from a thread pool in a service that does quite
I have an Android activity which in turn starts a thread. In the thread
friends, i have a page on which i am displaying image from gallery then
I have an application which upon start request around 10-12KB of data from server

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.