Unable to disable smart text

I'm trying to disable predictive text for a given EditText , as described here , but I'm still getting predictive auto-completion ...

I have a Samsung Galaxy S with XT9 enabled.

Can anybody help?

 <EditText android:id="@+id/search_field" android:layout_width="300dp" android:layout_height="27dp" android:background="@drawable/bg_searchfield" android:hint="@string/search_hint" android:imeOptions="actionSearch" android:inputType="text|textNoSuggestions|textFilter"/> 
+8
android android-edittext
source share
2 answers

Comment on this . The SO question assumes that the xml attribute does not work for some models, but that the java method really works in these cases. So try the following:

 edittext.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); 

change

As indicated in the comment below, an alternative to xml was used here:

 android:inputType="textNoSuggestions|textVisiblePassword" 
+19
source share
 android:inputType="textNoSuggestions|textVisiblePassword" 

This solution works, but you have to be careful with it. You cannot switch the keyboard language on HTC devices (probably the reason is the Sense keyboard) if the textVisiblePassword flag is set .

So I had to install InputType from the code and write something like this:

  public static int getInputTypeForNoSuggestsInput() { if (android.os.Build.MANUFACTURER.equalsIgnoreCase("Samsung")) { return InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD; } else { return InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS; } 
+5
source share

All Articles