InputDialog and ForceDoneButton ??

Gary Miyakawa

Active Member
Licensed User
Longtime User
(the more I learn, the more I learn I don't know.. :sign0013:

I'm using the InputDialog (excellent Tool!) and it brings up the "soft"Keyboard. If, at the end of entering the information, press the "enter" key, life is good. If you click on the "accept" (in the InputDialog box) then the keyboard stays visible til you press the back button.

I've looked at the InputDialog documentation and examples and I don't see any reference to ForceDoneButton (or equivalent)...

Thoughts ?

Gary M
 

agraham

Expert
Licensed User
Longtime User
Actually the InputBox should already display the keyboard with a Done button instead of the Enter button. That's why it closes the keyboard when you press it. Unfortunately when you exit the dialog without pressing Done the keyboard stays and the Done button reverts to Enter.

Unfortunately, for some reason possibly security related, Android does not appear to provide a simple way of doing the obvious thing of checking that the keyboard is shown and hiding it if it is. Google for "Android close keyboard" to see other developer frustration with this.

Close / Hide the Android soft keyboard a.k.a. “How to make that bloody keyboard go away”

The android keyboard can be a bit of a p.i.t.a. for developers who are trying to create a good user experience. Sometimes it won’t open when you would expect it to, and other times it will never dismiss without the user having to hit the back button (something which many android users wont realize). I’ve struggled often with the later situation
I don't know of an easy way round this that does - anyone?
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
I've tried all the "standard" work arounds but they don't work. I think it is because they need to be invoked in the context of the dialog while it is shown and not in the context of the activity that invoked the dialoag. And of course I can't get code to run in that context.
 
Upvote 0

Gary Miyakawa

Active Member
Licensed User
Longtime User
Thanks folks, I'm wondering if there is a way to get the Reflection library to help us here. I know agraham wrote it. If you think it might work, I'll give it a go and see if I can figure out something that is reliable.

I'm pretty much done with V1 of this app and this is one of the last things to completely resolve. I can certainly put in the "InputDialog" message to be sure and use the "done" button on the keyboard but that assumes someone reads that message (I wouldn't.. :) )

Anyway, thanks for thinking about this and as I have stated, this is a GREAT product! In my opinion, for Android, Basic4android is a game changer!

Cheers,

GaryM
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
I'm wondering if there is a way to get the Reflection library to help us here.
I think you have a misunerstanding of what the Reflection library is. There is nothing the Reflection library can do that I can't do in Java, and a lot that it can't. I'm afraid there is no solution to this - it's an Android quirk.
 
Upvote 0

Gary Miyakawa

Active Member
Licensed User
Longtime User
Quick question...

Is there any status I can look at thru B4A that will tell me the keyboard is visible on screen ?

Thanks,

Gary M
 
Upvote 0

Gary Miyakawa

Active Member
Licensed User
Longtime User
I guess my confusion come from, I was able to make it work correctly with "edittext" view... (and ForceDoneButton)....

Thanks for your explanations! It is very much appreciated..

GaryM
 
Upvote 0
Top