How to disable displaying suggestions on the Soft Keyboard
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.
How can I turn off suggestions in EditText?
It's already described in the link Yoni Samlan posted. You should read the documentation correctly ;)
There is a method called setInputType. All you need is to call it with
edittext.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
how to avoid soft keyboard showing auto correct suggestion?
To stop offering suggestions, add the following attribute to your EditText in XML:
android:inputType="textNoSuggestions"
and/or add multiple types using |
as below:
android:inputType="textNoSuggestions | text"
Android: AutoCompleteTextView hide soft keyboard
Use OnItemClickListener
. Hope this works :)
AutoCompleteTextView text = (AutoCompleteTextView) findViewById(R.id.auto_insert_meds);
text.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
InputMethodManager in = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
in.hideSoftInputFromWindow(arg1.getWindowToken(), 0);
}
});
UPDATED
Use this
in.hideSoftInputFromWindow(arg1.getApplicationWindowToken(), 0);
instead of -
in.hideSoftInputFromWindow(arg1.getWindowToken(), 0);
Related Topics
Place 2 Textview Beside Each Other with 2Nd Textview Always Visible
Error:Execution Failed For Task ':App:Transformclasseswithjarmergingfordebug'
Firebase Chat App Setvalue Failed Error With a Public Database
Convert Magnetic Field X, Y, Z Values from Device into Global Reference Frame
Android.Content.Context.Getpackagename()' on a Null Object Reference
A Way to Get Unlock Event in Android
How to Create a Resizable Rectangle with User Touch Events on Android
How to Add Footer to Navigationview - Android Support Design Library
Java.Net.Connectexception: Localhost/127.0.0.1:8080 - Connection Refused
How to Convert Ppi into Dpi for Android Images
Android: Android.Content.Res.Resources$Notfoundexception: String Resource Id #0X5
Android - Volume Buttons Used in My Application
Setting Drawable Folder to Use for Different Resolutions
Android - How to Get the Processname or Packagename by Using Pid