0

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

Bob G
  • 23
  • 2
  • 6

2 Answers2

2

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
Erel
  • 1,802
  • 2
  • 15
  • 58
  • Aha! I haven't looked at the Reflection library yet. Thank you for the code example - I will give it a try. – Bob G Oct 27 '11 at 18:52
  • The Reflection code example is the perfect solution. Now the on-screen keyboard only shows the keyboard (and auto-completion) and does not cover up the rest of my app. Now I don't have to reinvent the keyboard and auto completion. I'm gonna want to learn more about Reflections. Thanks so much! – Bob G Oct 27 '11 at 19:01
0

This is the default behavior of all Androids when in landscape. You may want to see this link for an implementation of custom keyboards:

Erel
  • 1,802
  • 2
  • 15
  • 58
  • Thanks Erel for your swift reply. I have already looked at the link for custom keyboards and could see using the examples as a starting point for making my own keyboard. If I make my own keyboard I will still need to provide auto completion in a manner similar to the Android keyboard. Is there a way to access the Android auto-completion library from B4A? – Bob G Oct 27 '11 at 18:26
  • PS: I'm playing around with another Android programming app and the text area associated with the on-screen keyboard does not show in landscape mode - only the keyboard is visible and the test app is still visible in the upper half of the screen. My guess is because the application is running in the browser (HTML5). – Bob G Oct 27 '11 at 18:38