Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable displaying "suggestions" on the Soft Keyboard

Tags:

android

I want to turn off displaying "Suggested Words" on the soft/virtual keyboard when someone is using my application (only on certain Activities). For the default Android keyboard, this can be found under 'Settings' (under Word Suggestion Settings).

Is there a way to disable it only within your application, without requiring the user to manually go and do it? I basically want the user to type words without providing any hints.

Thanks!

like image 394
Thira Avatar asked Nov 26 '10 00:11

Thira


People also ask

How to disable keyboard suggestions android?

Go to the keyboard app's settings. Scroll down and look for “Text Correction” or something similar. Tap on “Predictive Text” or “Next-Word Suggestions” to toggle the feature off. Test the keyboard and see if the option is disabled.

How to disable suggestions in EditText android?

android:inputType="none|numberDecimal" The suggestions will appear for user, but user will not be able accept them.

How do I close the keyboard on Android?

HIDE_IMPLICIT_ONLY, 0); Here pass HIDE_IMPLICIT_ONLY at the position of showFlag and 0 at the position of hiddenFlag . It will forcefully close soft Keyboard.


2 Answers

When developing for 2.0+, the supposed way is setting android:inputType="textNoSuggestions" (ref). Unfortunately, suggestions are still shown on HTC Desire 2.2 (and probably other HTC Sense devices as well).
Using android:inputType="textVisiblePassword"will not help as well as the software keyboard by HTC won't allow you to switch languages.
So I stick to android:inputType="textFilter" to disable suggestions.

like image 51
yanchenko Avatar answered Nov 12 '22 08:11

yanchenko


You can disable suggestions on the Soft Keyboard by adding the following line in the xml -

android:inputType="textNoSuggestions" 

However according to this article, it may or may not be supported by the IME (the keyboard).

If this issue occurs, the below method works for sure -

android:inputType="textNoSuggestions|textVisiblePassword" 
like image 31
Ameya Pandilwar Avatar answered Nov 12 '22 09:11

Ameya Pandilwar