9

I have an edittext for reply to email. i want to give three properties for edittext like Multiline, First character caps and disable word suggestions. I gave like this in xml...

android:inputType="textCapSentences|textVisiblePassword"

I tried in code also... etMessage.setInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE|InputType.TYPE_TEXT_FLAG_CAP_SENTENCES); I am not able to give multiline....how can i achieve this

thanks

Aju
  • 4,597
  • 7
  • 35
  • 58

2 Answers2

26

I found solution for this problem

Just set the following parameters in xml file..

android:inputType="textCapSentences|textVisiblePassword" These are for setting first letter of sentence to caps and disable suggestions

and write following code in ur Activity

edittext.setSingleLine(false);
Aju
  • 4,597
  • 7
  • 35
  • 58
  • 1
    Last code can also be done in XML: android:singleLine="false" – Loolooii Mar 08 '14 at 10:42
  • If you use textVisiblePassword, you loose the keyboard swipe option... You can do the same effect without the xxxxx like this: android:inputType="textCapSentences" – Jose Manuel Mar 11 '14 at 10:16
9

Try setting android:inputType="textMultiLine|textCapSentences|textVisiblePassword". What might be happening is that it is multiline but only one line is currently shown, in which you could say android:minLines="5" or so.

zim333311
  • 436
  • 1
  • 5
  • 16