7

When I open they soft keyboard in my app while in landscape mode, the keyboard covers my entire app. The only thing that is shown is the keyboard and a space at the top to enter text. Keyboard is appearing correct in portrait mode.

Michael Celey
  • 12,645
  • 6
  • 57
  • 62
Mohammed mansoor
  • 743
  • 3
  • 11
  • 18

1 Answers1

11

Basically its not a bug of your application. Its how your keyboard IME is designed. When user goes to landscape mode, it'll take up the whole screen.

You may install some third party IME from play store and see how it works in portrait mode.

As per the link given by MCeley below. You can do something as below

@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI;
}

or change your manifest for your activity as below

android:imeOptions="flagNoExtractUi" 

Read here for more discussion

Community
  • 1
  • 1
Jay Mayu
  • 17,023
  • 32
  • 114
  • 148
  • 1
    Yes, the entire screen is taken up because that is how the keyboard is designed. However, you can tell the native keyboard that you don't want to use this edit mode even in landscape. See the related question that the user got their solution from: http://stackoverflow.com/questions/4336762/disabling-the-fullscreen-editing-view-for-soft-keyboard-input-in-landscape – Michael Celey Mar 20 '13 at 12:48
  • Thanks for the link so `outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI;` does the magic – Jay Mayu Mar 20 '13 at 12:50
  • which is the minimum targer sdk to do this? mine is 2.3.3.. – Mohammed mansoor Mar 20 '13 at 14:56
  • Follow this link to getting answer http://developer.android.com/guide/topics/ui/controls/text.html#Flags – Krunal Shah Apr 03 '14 at 04:58
  • 1
    It's enough to just add android:imeOptions="flagNoExtractUi" inside a particular EditText element. – goRGon Oct 13 '14 at 22:43