Android Question Is there an inputbox modal that won't keep the keyboard?

An Schi

Well-Known Member
Licensed User
With the phone library you can do:

Dim p As Phone
p.hidekeyboard (Activity)

when you want the keyboard to disappear.

(Just searched for this myself some hours ago ;))
 
Upvote 0

rafaelmotaquintana

Active Member
Licensed User
It doesn't works in this situation.
Funny think is that numeric only keyboard sometimes hides after dialog closes. But text mode keyboard always remains alive, you need to press back buttom
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
I've tried some, including betterdialogs.
I need the keyboard to disappear after the text is entered.
Thanks
If the virtual keyboard is opened with the OpenKeyboard property of BetterDialogs, then it is properly closed when the dialog is closed. BUT it cannot be closed if you open it by clicking on the EditText because BetterDialogs does not know that a virtual keyboard is opened. It's not related at all to the modality of the dialog. Run the following code after CustomDialog and the virtual keyboard will close:
B4X:
Dim r As Reflector
r.Target = BD
r.RunStaticMethod("flm.b4a.betterdialogs.BetterDialogs", "FermerClavierVirtuel", Array(r.GetActivityBA), Array As String("anywheresoftware.b4a.BA"))
 
Upvote 0

Dave O

Well-Known Member
Licensed User
Longtime User
If you just call hideKeyboard, it sometimes doesn't work.

Putting that call into a CallSubDelayed has worked for me, like this:

B4X:
Sub someSubroutine
  ...
  CallSubDelayed(Me, "hideKeyboard")
end sub

Sub hideKeyboard
   Dim ime1 As IME
   ime1.HideKeyboard
End Sub

I'm assuming that the app needs time to finish updating the UI before dealing with the keyboard. Hope this helps!
 
Last edited:
Upvote 0
Top