java - Turn \r\n to a new list item in Android -
i'm being handed string such hello there my\r\nname is\r\njohn smith\r\nand\r\nstuff , want put each line in new list item... such as:
desired result (list view separate list items):
hello there -------------- name -------------- john smith -------------- , -------------- stuff i figured able parse entire string \r\n put each line array , use array adapter set list view, interprets \r\n new line. end having text view looks this:
current result (just 1 textview):
hello there name john smith , stuff is there way stop \r\n creating new line can parse array?
string[] mytext = {"helo there my", "name is", "john smith", "and", "stuff"};
have tried this?:
string[] mytext = originaltext.split("\r\n");
Comments
Post a Comment