4

In my app, for particular EditText, I want first letter of the sentence to be Capital/Upper case. So I used android:inputType="textCapSentences".

The strange thing is this works on emulator, but doesn't work on emulator. I even tried android:capitalize="sentences" even though it's deprecated, but it didn't work.

Related facts:

  • Emulator OS: 4.0.3

  • Real device OS: 4.0.4

  • App minSdk version: 2.3.3

I also tried with emulator with 4.2.2 OS but the result was same.

Can anyone suggest anything I can try? Any help appreciated.

GAMA
  • 5,958
  • 14
  • 79
  • 126

1 Answers1

3

Have you tried setting this programmatically?

EditText input = new EditText(this);
input.setInputType(InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);

Moreover, you have to be aware that "Input method editors (IMEs) do not have to honor all the settings in android:inputType. Those are suggestions or requests that you are making, not demands."(android:inputType="textCapSentences" Not Always Honored)

Community
  • 1
  • 1
Mathieu Castets
  • 5,861
  • 3
  • 28
  • 37