开发者

Dialog with a Spinner + orientation change

开发者 https://www.devze.com 2023-02-27 03:07 出处:网络
I have a Dialog with a Spinner. This is a managed dialog (ie I use showDailog(DIALOG_ID) to show it).

I have a Dialog with a Spinner. This is a managed dialog (ie I use showDailog(DIALOG_ID) to show it).

If I click on the Spinner there are 2 dialogs now - the main dialog and the Spinner popup. After screen orientation it crashes. I can see 2 exceptions in LogCat, the first is WindowLeaked and the second IlleagalArgumentException: View not attached to window manager.

I guess t开发者_JS百科his is a bug in Android, but is there a way to workaround this?


Also struggled with this and wrote down my experiences regarding progress dialogs and orientation changes on this blog post.

Required a lot of code plumbing to do it right (the official Android way to handle config and orientation changes), or a simple attribute on the activity in the manifest as a "workaround" without code changes.

0

精彩评论

暂无评论...
验证码 换一张
取 消