Android Question @ symbol in soft keyboard

jimseng

Active Member
Licensed User
Longtime User
Hello.
I have an edit text for email addresses. I have been searching to no avail as to how to have the @ character on the keyboard without having to press the ?123 button. I am sure this is easy but I can't find it.
 

LucasHeer

Active Member
Licensed User
Longtime User
Hello.
I have an edit text for email addresses. I have been searching to no avail as to how to have the @ character on the keyboard without having to press the ?123 button. I am sure this is easy but I can't find it.

Hello!

This is definitely possible:

B4X:
Dim use_suggestions As Boolean = False
Dim INPUT_TYPE_TEXT As Int = 0x00000001
Dim INPUT_TYPE_EMAIL As Int = 0x00000020
Dim INPUT_TYPE_NOSUGGESTIONS As Int = 0x00080000

Dim et As EditText = txt_username.NativeTextField
et.InputType = Bit.Or(Bit.Or(INPUT_TYPE_TEXT, INPUT_TYPE_EMAIL), INPUT_TYPE_NOSUGGESTIONS)
If(use_suggestions) Then
    et.InputType = Bit.Or(INPUT_TYPE_TEXT, INPUT_TYPE_EMAIL)
Else
    et.InputType = Bit.Or(Bit.Or(INPUT_TYPE_TEXT, INPUT_TYPE_EMAIL), INPUT_TYPE_NOSUGGESTIONS)
End If

I am using AS_TextFieldAdvanced for my EditText, but you would replace "et" with your EditText.

Or simply:
B4X:
et.InputType = 33

You can also enable or disable suggestions on your preference. The above code will replace the comma with "@" on most phones:
 
Last edited:
Upvote 0

jimseng

Active Member
Licensed User
Longtime User
Thanks. I will try this. I can't find where a reference or tutorial is for this. I have seen the EMI tutorial but is there a list of input types shown somewhere?
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Thanks. I will try this. I can't find where a reference or tutorial is for this. I have seen the EMI tutorial but is there a list of input types shown somewhere?

 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…