Попробуйте это: eText_key1.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
В качестве альтернативы вы можете поместить следующее в XML-определение EditText: android:inputType="textFilter"
.
EDIT:
Вот пример, просто убедитесь, что вы определяете настройки в логике переключения и макете xml или инициализируете тип ввода в onCreate:
setContentView(R.layout.edittext);
Button switchButton = (Button) findViewById(R.id.switchbutton);
final EditText editText = (EditText) findViewById(R.id.password);
switchButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (passwordShouldBeVisible) {
editText.setInputType(InputType.TYPE_CLASS_TEXT
| InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
} else {
editText.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD
| InputType.TYPE_CLASS_TEXT
| InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
}
}
});
и вот файл XML, который я использую:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<EditText
android:id="@+id/password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="text|textFilter"/>
<Button
android:id="@+id/switchbutton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Switch" />
</LinearLayout>