Edit text without autocorrect

I want EditText without auto-correction. I set textNoSuggestions inputType as shown below:

 <EditText
    android:id="@+id/txtTarga"
    android:layout_width="150dp"
    android:layout_height="wrap_content"
    android:ems="10"
    android:hint="Targa"
    android:inputType="textNoSuggestions|textCapCharacters" >

The capital flag works, but it is still auto-correcting.

How to disable it?

+5
source share
5 answers

inputType textVisiblePassword will do the trick (in most cases, because, as Commonsware pointed out, it remains in the request, and you find that you find devices where they work and devices where it doesn't work)

+21
source
android:inputType="textNoSuggestions"

in accordance with this attribute inputType may be supported or not supported by all devices.

However, it seems to work more often.

android:inputType="textNoSuggestions|textVisiblePassword"
+9
source

, :

EditText edittext = (EditText)findViewById(R.id.txtTarga);
edittext.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
0

In xml

<EditText
        android:id="@+id/password"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:hint="password"
        android:imeOptions="actionDone"
        android:inputType="textPassword"
        android:singleLine="true"
        />

In java source code

    // casting done from EditText to TextView

    TextView mPassword = (TextView) findViewById(R.id.password);

I don’t know why this is. But it works great.

0
source

The accepted answer inputType="textVisiblePassword"works, but it removes emojis from most keyboards.

I found that the setup inputType="textUri"works and retains the ability to add emoticons.

0
source

All Articles