java – How to disable spelling corrections programmatically in Android-ThrowExceptions

Exception or error:

How can I disable spelling corrections in an EditText‘s soft-keyboard programmatically in Android? The user can disable it from settings, but I need to disable it in my application.

Is there any way to do this?

How to solve:

Set this in your layout’s xml for your EditText:


Or call setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS) in your Activity’

If you need to support API 4 and below, use android:inputType="textFilter"


If setting:


still doesn’t work (and your text field is small), a quick work-around is to use:


Leave a Reply

Your email address will not be published. Required fields are marked *