Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

In my case, after changing screen orientation, and clicking Okay button in permission dialog box crashes the app.

like image 512
Sudhir Sinha Avatar asked Dec 12 '25 13:12

Sudhir Sinha


1 Answers

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

like image 122
Sudhir Sinha Avatar answered Dec 14 '25 11:12

Sudhir Sinha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!