GoCrazy GoCrazy - 1 year ago 78
Android Question

New line (/n) not Supporting in android?

I am trying to split the single string in to two lines using /n in android but it shows as it is with /n too. I am expecting below,

String new = "Hi, How are you";

In EditText box i need,


How are you

I know its simple question but i couldn't find a solution. please help....


Answer Source

I think you are new into android development like me. It's really easy to do...

You just have to do this:

editText.setText("Hi,\nHow are you?");