Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android newline in my EditText

i got some data like this "line 1 \n line 2" from my distant server by using json with utf8 encoding, and when i try to put the data in my EditText the newline \n doesn't work in spite of unscaping the data by using URLDecoder.decode() because i use databases. Any suggestions

all the best .

like image 639
sami boussacsou Avatar asked Sep 13 '10 21:09

sami boussacsou


2 Answers

Solved , by using

myString.replace("\\n", "\n");
like image 178
sami boussacsou Avatar answered Oct 31 '22 17:10

sami boussacsou


String value=userdataArrayList2[0].toString().trim().replace("\\n", "\n");

In back end database insert data like this :

name is osama\nibrahim 

result:

name is osama
ibrahim
like image 20
Osama Ibrahim Avatar answered Oct 31 '22 17:10

Osama Ibrahim