I have a custom AlertDialog which is opened by a button click. I have made two xml layouts for it. Normal portrait layout and landscape which I put into res/layout-land folder. When dialog is opened, I change the screen orientation and it won't refresh to apply respective xml layout. But if I open the dialog after I changed orientation, correct xml will be inflated.
I have tried with and without this line in my AndroidManifest.xml,
android:configChanges="orientation|screenSize"
and without it, it is even worse. Dialog gets closed and the keyboard is opened. I don't know what is going on there. One way would be to reopen dialog by hand, but I don't know how to do that either. I'm starting a dialog on a button click inside fragment's onCreateView. Other than that, I don't have any other method set up regarding AlertDialog.
Thanks in advance!