Sub ShowKB
DoEvents
Dim IME As IME
DoEvents
IME.ShowKeyboard(QueryTxt)
End Sub
SetActivityAttribute(main, android:windowSoftInputMode, adjustResize|stateHidden)
SetActivityAttribute(main, android:windowSoftInputMode, adjustPan|stateHidden)
When I used the code below, I got "java.lang.RuntimeException: Method: setIMEOptions not found in: java.lang.string:By default the keyboard appears this way in landscape orientation.
You can disable this behavior with this code:
B4X:Dim jo As JavaObject = EditText1.Text jo.RunMethod("setImeOptions", Array As Object(268435456)) 'IME_FLAG_NO_EXTRACT_UI
Dim JO As JavaObject
JO = edtMap.Text
JO.RunMethod("setImeOptions", Array As Object(268435456)) 'IME_FLAG_NO_EXTRACT_UI
OK now for landscape input except that keyboard now shows Done rather than Next. Also, after clicking Done, keyboard is hidden (as executed by code) but there is no automatic progression (as requested by code shown below in IME_HandleAction event's code for the edtMap EditText):My mistake. It should be Dim jo As JavaObject = EditText1 (not .Text).
Dim R As Reflector
R.Target = edtMap
R.RunMethod2("setFocusable", TrueFalse, "java.lang.boolean")
R.RunMethod2("setFocusableInTouchMode", TrueFalse, "java.lang.boolean")