-1

I use this json code in a url in web and I get it in a textview.

[

  {
    "des": "text\r\ntext2\r\ntest3"
  }
]

Show in text view

texttext2text3

In textview display my text in one line but i want displayed it in multiline.

text
text2
text3

can you help me?

  • Possible duplicate of [How to add a line break in an Android TextView?](http://stackoverflow.com/questions/5382490/how-to-add-a-line-break-in-an-android-textview) – dgiugg Feb 16 '16 at 10:51

2 Answers2

0

Hope it will help you !

parse this json and get HTML as a string.

String htmlStringGot = parsedJSONStringValue;

txt.setText(Html.fromHtml(Html.fromHtml(htmlStringGot).toString()));
Rahul
  • 510
  • 3
  • 8
0

Add this line to your TextView

<TextView 
    android:maxLines="3"   
/>

Multi line textview

Hope this helps u out.

Community
  • 1
  • 1
Strider
  • 4,452
  • 3
  • 24
  • 35