How to get this in the same string . I get this issue only while pressing the enter key in the keyboard and proceeding the typing .
It always the same string. If you want it on the same line you can try string.replace() to strip away line breaks. For instance
String content = editText.getText.toString();
content = content.replace("\n", "");