Keyboard

Rusty

Well-Known Member
Licensed User
Longtime User
I have written a simple edittext sample to eliminate all complexities. Is there a way to have the keyboard show without the user having to click the edittext? In other words, when the activity starts, have the (appropriate) keyboard already be displayed for the edittext control.
Also, when the keyboard is displayed, is there a way to get the keyboard only and no "text entry" panel just above the keyboard? (I want to have the keyed characters/numbers appear within the edittext control without any intermediate display area.) Thanks,
Below is the very simple example:

'Activity module
Sub Process_Globals
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim editText1 As EditText
activity.LoadLayout("TextSample")
activity.Initialize("Edit Text Sample")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The type of keyboard displayed is determined by setting EditText.InputType.
You can make the keyboard display by default by editing AndroidManfiest.xml which is located in <project>\Objects. Remove this line: android:windowSoftInputMode="stateHidden"

You will need to set the file to be read only after the change or it will be overwritten.

Not sure that I see which panel you are referring to...

BTW, there is no need to initialize the Activity. You should only initialize views added programmatically.
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Sorry, I should have shown the inputtype selection, but it doesn't matter which input type I use, the keyboard shows the "input" panel as in the attached image. I am wanting just the keyboard keys and the edittext object to be displayed. The panel area i am referring to is surrounded by an orange line.

I removed the line within the xml file and nothing changed. (I also set the xml file to read only. when i compile, it states using existing read only manifest)
Thanks for the help.
 
Last edited:
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Is there any way to intercept the keystrokes before they are displayed within this panel? I'd like to validate the data as it is keyed into the control.
Basically, what I'm trying to do is to allow someone to key data into a mask where values are controlled. For example, if I were wanting to accumulate a person's height, I would not want 9 feet or 1 foot, but I do want a numeric input.
Thanks, Erel
 
Upvote 0
Top