-2

Possible Duplicate:
How to deal with orientation change with a ProgressDialog showing?

08-14 17:23:31.078: E/AndroidRuntime(25099): FATAL EXCEPTION: main
08-14 17:23:31.078: E/AndroidRuntime(25099): java.lang.IllegalArgumentException: View not attached to window manager
08-14 17:23:31.078: E/AndroidRuntime(25099):    at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:378)
08-14 17:23:31.078: E/AndroidRuntime(25099):    at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:223)
08-14 17:23:31.078: E/AndroidRuntime(25099):    at android.view.Window$LocalWindowManager.removeView(Window.java:432)
08-14 17:23:31.078: E/AndroidRuntime(25099):    at android.app.Dialog.dismissDialog(Dialog.java:278)
08-14 17:23:31.078: E/AndroidRuntime(25099):    at android.app.Dialog.access$000(Dialog.java:71)
08-14 17:23:31.078: E/AndroidRuntime(25099):    at android.app.Dialog$1.run(Dialog.java:111)
08-14 17:23:31.078: E/AndroidRuntime(25099):    at android.app.Dialog.dismiss(Dialog.java:268)
08-14 17:23:31.078: E/AndroidRuntime(25099):    at android.app.Dialog.cancel(Dialog.java:951)

Above is what I am getting when I rotate my screen while my progress dialog is being shown. How can I handle this problem...

Community
  • 1
  • 1
Debopam Mitra
  • 1,842
  • 4
  • 27
  • 51
  • Have you tried this `android:configChanges="orientation"` in your activity? – Praveenkumar Aug 14 '12 at 12:01
  • I tried.. It worked.. but my activity layout is different in landscape and portrait. when I start with portrait.. the landscape's original layout is replaced with potrait's layout. Can you help me out? – Debopam Mitra Aug 14 '12 at 12:46

2 Answers2

1
try this one

 <activity android:label="@string/app_name" 
    android:configChanges="orientation|keyboardHidden" 
    android:name=".your.package">
  • 2
    I tried.. It worked.. but my activity layout is different in landscape and portrait. when I start with portrait.. the landscape's original layout is replaced with potrait's layout. Can you help me out? – Debopam Mitra Aug 14 '12 at 12:44
0

please insert this line to your activity in menifest

 <activity
            android:name="your activity" android:configChanges="keyboardHidden|orientation"
          />
Atul Bhardwaj
  • 6,647
  • 5
  • 45
  • 63
  • I tried.. It worked.. but my activity layout is different in landscape and portrait. when I start with portrait.. the landscape's original layout is replaced with potrait's layout. Can you help me out? – Debopam Mitra Aug 14 '12 at 12:45
  • Check this (http://stackoverflow.com/questions/151777/saving-activity-state-in-android) – Atul Bhardwaj Aug 14 '12 at 13:38