Android Question FileDialognot closing keyboard

mscientist33

Active Member
Licensed User
I am using the FileDialog. Everything works correct except it does not close the keyboard.

B4X:
Private sf As Object=fd.ShowAsync("Save file: " ,"OK","Cancel","",Null,False)
    wait for (sf) dialog_result (rt As Int)
    If rt=DialogResponse.POSITIVE Then
        ToastMessageShow(fd.ChosenName , False)
    End If

Any ideas?
 

mscientist33

Active Member
Licensed User
I have tried using the IME library. I tried putting the ime.HideKeyboard after the code about but it does not hide. I have considered the content chooser but it seems to be difficult to use compared to the FileDialog as I have to use external storage and I need to be able to return the file selected when doing a file open.
 
Upvote 0

mscientist33

Active Member
Licensed User
Found out my problem. On closing the edittext was getting focus back re-opening the keyboard...... just requested focus for a button after the code...



I take that back... that only works in one place in my code...

I guess I should be asking how to click the "Done" button programmatically?
 
Last edited:
Upvote 0

mscientist33

Active Member
Licensed User
I see that my problem has been you *must* click the Done button on the keyboard, just hitting ok on the dialog will not close the keyboard..... Irritating as user but I guess it is what it is.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
If you are using the FileDialog from my Dialogs2 library try a Sleep before hiding the keyboard. try different sleep periods if necessary.
B4X:
        Dim fda As Object = fd.ShowAsync("B4A File Dialog", "Yes", "No", "Maybe", Bmp, False)
        Wait For (fda) Dialog_Result(ret As Int)
        Dim IME As IME
        IME.Initialize("")
        Sleep(50)
        IME.HideKeyboard
 
Last edited:
Upvote 0

mscientist33

Active Member
Licensed User
I am currently using the Dialogs library 4.01. I will see how hard it would be to swap out with your Dialogs2 library (once I find it ;) )
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
 
Upvote 0
Top