GoCrazy GoCrazy - 5 months ago 12
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,

Hi,

How are you

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

thanks

MAC MAC
Answer

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?");