-2

可能重复:
如何处理显示 ProgressDialog 的方向变化?

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)

以上是我在显示进度对话框时旋转屏幕时得到的结果。我该如何处理这个问题...

4

2 回答 2

1
try this one

 <activity android:label="@string/app_name" 
    android:configChanges="orientation|keyboardHidden" 
    android:name=".your.package">
于 2012-08-14T12:03:20.687 回答
0

请将此行插入您在清单中的活动

 <activity
            android:name="your activity" android:configChanges="keyboardHidden|orientation"
          />
于 2012-08-14T12:01:57.070 回答