There are numerous threads in the forum about this, but I didn't have much luck with them. I wanted to disable the suggestions, but they always showed. I saw one suggestion setting the field to be for email, which disabled the suggestions - but that's clearly just a dirty workaround.
This is the relevant documentation: android:inputType
In the forum we can see the suggestion for code like this:
and sometimes this:
That code targets this flag:
(Note: The value displayed for this flag seems to have a typo. Clicking the blue link reveals that the flag actually has the value 0x80000.)
Which seems reasonable. The problem is that it seems to not work.
To remove suggestions it seems that two flags needs to be targeted. Both enabling the one above, and disabling this one:
Which means that to remove suggestions, this is a working solution:
Or, if you want to be a bit more correct, do the Bit.Or for 0x80000 and then Bit.And 0xFFFFE. (To remove the 1, if it was set.)
IMPORTANT UPDATE:
What I wrote above is not entirely correct. It was tested on a device using "Android Keyboard (AOSP)" on Android 6, and there it worked as expected. When I tried the same thing on another device (that ran same OS version as first one) it failed to disable the suggestions.
After some investigation it seems that Gboard is the problem. Read this post at Stack Overflow for more information: Programmatically disable auto-suggestions on Gboard. (I can only assume that other keyboards also have quirks, I have not tried any more than these two though.)
However, I have verified that 0x21 (textEmailAddress) works for all my devices. Which means we've come full circle to the dirty workaround mentioned initially. *sigh*
This is the relevant documentation: android:inputType
In the forum we can see the suggestion for code like this:
B4X:
editText.InputType = Bit.Or(editText.InputType, 0x80000)
and sometimes this:
B4X:
editText.InputType = Bit.Or(editText.InputType, 0x80001)
That code targets this flag:
(Note: The value displayed for this flag seems to have a typo. Clicking the blue link reveals that the flag actually has the value 0x80000.)
Which seems reasonable. The problem is that it seems to not work.
To remove suggestions it seems that two flags needs to be targeted. Both enabling the one above, and disabling this one:
Which means that to remove suggestions, this is a working solution:
B4X:
editText.InputType = 0x80000
Or, if you want to be a bit more correct, do the Bit.Or for 0x80000 and then Bit.And 0xFFFFE. (To remove the 1, if it was set.)
IMPORTANT UPDATE:
What I wrote above is not entirely correct. It was tested on a device using "Android Keyboard (AOSP)" on Android 6, and there it worked as expected. When I tried the same thing on another device (that ran same OS version as first one) it failed to disable the suggestions.
After some investigation it seems that Gboard is the problem. Read this post at Stack Overflow for more information: Programmatically disable auto-suggestions on Gboard. (I can only assume that other keyboards also have quirks, I have not tried any more than these two though.)
However, I have verified that 0x21 (textEmailAddress) works for all my devices. Which means we've come full circle to the dirty workaround mentioned initially. *sigh*
Last edited: