Search code examples
basic4android

Android on-screen keyboard and B4A


I am wondering about the on-screen keyboard (osk).

When I’m in portrait mode the osk shows up on the bottom of the screen and only covers up the lower portion of my app. This is ideal because you can still see my text box which is located in the upper portion of the app. But when the orientation is changed to landscape, the osk covers up the entire app (hiding my text box) with its own text area.

This osk text area only shows in landscape mode. Is this how the osk behaves on all Androids or is it specific to Samsung Tab 7" or something else?

Is there a way to prevent the osk from displaying its own text box in landscape mode? If not, I will have to design my own osk. If I do design my own osk can I still take advantage of Android's auto completion through B4A?

I have tried the AutoCompleteEditText but it does not work the way that the Android auto completion does which is closer to what I need.

Any suggestions?

Thank you for your help,

Bob Gately


Solution

  • Better answer. You can use the reflection library to disable the full screen keyboard:

    Dim r As Reflector
    r.Target = EditText1
    r.RunMethod2("setImeOptions", 268435456, "java.lang.int") 'IME_FLAG_NO_EXTRACT_UI constant