Android Question How to disable spellcheck in AS TextFieldAdvanced?

Tareq Khan

Member
Licensed User
Longtime User
I would like to disable spellcheck in AS TextFieldAdvanced, so that I don't see the red underline below texts.

I tried the following, but it crashes.

B4X:
Private Sub DisableSpellcheckAS(tf As AS_TextFieldAdvanced)
    ' Get the internal B4XView containing the native EditText
    Dim tfJO As JavaObject = tf 
    Dim bxv As B4XView = tfJO.GetField("m_EditText")
    
    ' Get the native EditText view from the B4XView
    Dim etJO As JavaObject = bxv
    etJO.RunMethod("setInputType", Array(Bit.Or(0x00080000, 0x00000090))) ' NO_SUGGESTIONS | VISIBLE_PASSWORD
End Sub

Can you please help? Thanks.
 

Tareq Khan

Member
Licensed User
Longtime User
The problem here is, that you need to access the native edittext:
B4X:
AS_TextFieldAdvanced1.NativeTextField


B4X:
Private Sub DisableSpellcheckAS(etJO As JavaObject)
    etJO.RunMethod("setInputType", Array(Bit.Or(0x00080000, 0x00000090))) 
End Sub

I called the Sub like below:
B4X:
DisableSpellcheckAS (xtf_Email.NativeTextField)

It woked and I don't see any spell check red line.

However, it turned off the auto suggessions also. Is there any way to disable the spellcheck but keep the auto suggessions?

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