4

I have a problem with showing keyboard in landscape mode. My activity contains an EditText where user must type a license number, and a Button ok. It looks like this (image is rotated) enter image description . I put the following code to appear the keyboard when activity starts :

imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);  
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,InputMethodManager.HIDE_IMPLICIT_ONLY);
imm.showSoftInput(this.licenseText,InputMethodManager.SHOW_FORCED);

and now my activity starts like this (image is rotated) : enter image description

My question is : why it looks like this? If it is in portrait mode, the keyboard appear on the bottom side but not affect the contain of current view. I put the EditText on the top side for this, to appear the keyboard on bottom. Can anyone explain me why this looks like this or if i can change this?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Gabrielle
  • 4,933
  • 13
  • 62
  • 122

2 Answers2

9

Try setting android:imeOptions="actionDone|flagNoExtractUi".

This sounds like the same issue discussed in Unproportional keyboard on landscape layout Android

Community
  • 1
  • 1
Frank Leigh
  • 5,262
  • 1
  • 15
  • 18
0

The answer which gave by @Frank was right but you can do programmatically by this:

editText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
Ahmad Arslan
  • 4,498
  • 8
  • 38
  • 59