18

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?

0xCursor
  • 2,242
  • 4
  • 15
  • 33
Adem
  • 9,402
  • 9
  • 43
  • 58

2 Answers2

52

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

android:inputType="textNoSuggestions"

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"

CrackerJack9
  • 3,650
  • 1
  • 27
  • 48
10

If setting:

 android:inputType="textNoSuggestions" 

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

 android:inputType="textVisiblePassword"
pjheink
  • 306
  • 2
  • 5