I have an android app with an EditText field in one of my layouts. I have set android:inputType="textNoSuggestions"
attribute for my EditText. The text field no longer displays suggestions. However, the suggestions bar is still at the top of the soft keyboard and right now seems to only serve the purpose of displaying the voice input microphone icon. I don't want/care about voice input for this field either, and would like to remove the suggestions bar from this soft keyboard. Is there a way to do that, possibly with another inputType flag?
editTextNum. setShowSoftInputOnFocus(false); to disable the software keyboard showing when the EditText is touched. the hideKeyboard(this); call in OnCreate to forcible hide the software keyboard.
I've found a solution that works for me. Looking at the logcat while pressing the search bar in Google Now launcher shows the following:
07-03 19:50:07.760 1304-1304/? W/LatinIME﹕ Deprecated private IME option specified: nm
07-03 19:50:07.760 1304-1304/? W/LatinIME﹕ Use com.google.android.inputmethod.latin.noMicrophoneKey instead
So, what I did was adding this line in the EditText xml:
android:privateImeOptions="nm"
"nm" is taken from the source code of LatinIME: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.0.1_r1/com/android/inputmethod/latin/LatinIME.java#93
public static final String IME_OPTION_NO_MICROPHONE_COMPAT = "nm";
Hope this helps!
The combination of XML attributes that removed both the Suggestions and the Suggestions Bar while retaining multi-line text was the following:
android:privateImeOptions="nm"
android:inputType="textNoSuggestions | textMultiLine"
or
android:privateImeOptions="nm"
android:inputType="textFilter | textMultiLine"
Add android:inputType="textNoSuggestions" to editext
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With