简体   繁体   English

Android Marshmallow 中屏幕方向更改时的权限对话框使应用程序崩溃

[英]Permission Dialog while Screen Orientation change in Android Marshmallow crashing the App

How to handle permission dialog box during screen orientation in Android M devices?如何在 Android M 设备的屏幕方向期间处理权限对话框?

In my case, after changing screen orientation, and clicking Okay button in permission dialog box crashes the app.就我而言,更改屏幕方向后,单击权限对话框中的“确定”按钮会使应用程序崩溃。

My workaround for this situation: Once permission dialog box is coming, I am locking up the screen to its current orientation (portrait/landscape).我对这种情况的解决方法:一旦权限对话框出现,我将屏幕锁定到其当前方向(纵向/横向)。 When user presses the button, I am unlocking the screen.当用户按下按钮时,我正在解锁屏幕。

For Locking/unlocking the orientation, refer the link: Android: Temporarily disable orientation changes in an Activity对于锁定/解锁方向,请参阅链接: Android:临时禁用活动中的方向更改

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM