If you want to capitalise the first letter of every word in a EditText,
assign android:inputType=”textCapWords” to EditText.


<EditText android:id="@+id/txtCapitalize"

The same can be done programatically also as shown below.

TextView txtCapitalize = (TextView) findViewById(R.id.txtCapitalize);

txtCapitalize.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_WORDS);
Android How to Capitalize Every First letter of Word in EditText

Ravi is hardcore Android programmer and Android programming has been his passion since he compiled his first hello-world program. Solving real problems of Android developers through tutorials has always been interesting part for him.

  • Проолтпаа Прссмтлг

    in emulator s4 api17 not work

  • Deval Khandelwal

    Or, you can use android:inputType=”textCapWords” in the EditText

    • boyapati Subrahmanyam

      Yes, you can

    • Naman Khandelwal

      Well see the post again

  • raju SHINGADIA

    please check your code you are using textview in java