2

I m using adjustResize for my main Activity in Android app. When dialog are shown they are also adjusted to resize. But I need the dialog to be full screen like;

enter image description here

I tried to use getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); but this is not helpful. How to get it to work?

Ammar
  • 1,811
  • 5
  • 26
  • 60
  • see more code here http://stackoverflow.com/questions/6329360/how-to-set-dialog-to-show-with-full-screen –  Jan 07 '15 at 12:53

1 Answers1

1

After some research, found the solution. To display dialog in front of keyboard following flag is needed to be set on Dialog instance;

dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM, WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);

Reference: Android API Docs

Ammar
  • 1,811
  • 5
  • 26
  • 60
  • I LOVE THIS ANSWER. Thank you so much!! I ended up answering my own question too thanks to this wonderful answer: https://stackoverflow.com/questions/63596366/prevent-bottomsheetdialogfragment-from-hiding-keyboard/63608679#63608679 – coolcool1994 Aug 27 '20 at 03:22