android - \n appears in string is not funcional -


when getstring of database:

inf = c.getstring(5); //inf equals "hello how you?\nfine , you\ni fine, thanks."; 

when print appears in same way , not execute parameters "\ n":

tv1.settext(inf);  //the text "is hello how you?\nfine , you\ni fine, thanks." 

but want:

 "hello how you?     fine ,     fine, thanks." 

what problem?

the solution me:

    string finalinf = inf.replace("\\n", system.getproperty("line.separator")); tv1.settext(finalinf); 

thanks : skaard-solo , rest.

i think can try

string finalinf = inf.replace("\\n", system.getproperty("line.separator")); tv1.settext(finalinf);   system.getproperty("line.separator"))  

is system replacement new line


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -