2

Following is my dialog which gets dismiss on tablet lock or when the tablet display sleeps. I just wanted to ask how to avoid dismissal of dialog before completion of configuration process ?

Thanks in advance.

enter image description here

CRUSADER
  • 5,486
  • 3
  • 28
  • 64
Shubham
  • 1,442
  • 3
  • 16
  • 34

1 Answers1

1

Based on your screenshot, I assume that you have force your application to be in portrait mode, right?

If so, then when your application is in portrait mode and you turn off/lock the screen and then if you turn on the screen, the locker is in landscape right? That means your last activity have to be recreated.

So If your app is locked to portrait mode, you can add in the manifest android:configChanges="orientation|screenSize"

That means you will handle this config changes by yourself. This is basically a bad practise if you use it as a workaround as a "solution" config changes if you dont know what are you doing (see more at Why not use always android:configChanges="keyboardHidden|orientation"?). But if you force your app to be in Portrait, then it is ok.

Community
  • 1
  • 1
traninho
  • 1,533
  • 12
  • 19