我在AsyncTask对象的onPreExecute方法中显示了一个ProgressDialog,并在onPostExecute方法中取消了该ProgressDialog。在doInBackground方法中,我为用户注册发出一个超文本传输协议请求。我希望允许屏幕方向更改。当我在doInBackground方法仍在运行的时候改变方向时,我得到了各种有趣的错误,比如“IllegalArgumentException: View not attached to window manager”和“RegisterScreen has leaked window...”。
在方向更改后,如何正确地继续显示ProgressDialog?或者,在用户请求提交注册后,如何禁用方向更改?
发布于 2014-03-18 18:34:08
在我的例子中,我使用了
android:configChanges="orientation" 但它对我不起作用
下面的代码运行良好
<activity android:name=".MyActivity" 
          android:configChanges="orientation|screenSize|screenLayout">
</activity>https://stackoverflow.com/questions/3695484
复制相似问题