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
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"))