在解决这个论坛很长的搜索,我发现很多的答案,人们提出使用方案,以避免对话旋转后辞退,就像:
After a long search around this forum, I found a lot of answers where people propose using solutions for avoiding dialogs to dismiss after rotation, just like:
android:configChanges="keyboardHidden|orientation"
或覆盖下面的方法,这似乎是最值得推荐的:
Or override the following method, which appeared to be the most recommended:
protected Dialog onCreateDialog(int id)
但是,环顾四周Android的参考文档后,我会注意到,这些对话的方法被去precated。
But, after look around the Android Reference Documentation, I could notice that these Dialog methods are being deprecated.
因此,一个显而易见的问题是:
So, the obvious question is:
今天,什么是避免对话框的设备旋转后驳回最好的方法是什么?的
在此先感谢。
您现在应该使用的 DialogFragment 新片段的API。为了降低平台上使用它,比3.0,使用兼容包。
You should now use DialogFragment from new Fragments API. To use it on the platform lower, than 3.0, use compatibility package.
上一篇:在整合Authorize.net的API为Android问题问题、net、Authorize、Android
下一篇:onActivityResult是从来没有所谓的TabActivity从来没有、onActivityResult、TabActivity