java - Android Eclipse Split for newline -
in application android i've inserted :
log.i("myapp1", response.tostring());
this output of logcat in eclipse response.tostring:
04-08 20:54:21.674: i/myapp1(9930): 23/03/2014<br />pics 1<br /><br /><br />09/03/2014<br />pics 2<br /><br /><br />
how output in layout android? need tried split < br /> without success...
23/03/2014 pics 1 09/03/2014 pics 2
instead of <br />
html code use \n
in code.
string editedresponse = response.replaceall("<br />", "\n"); log.i("myapp1", editedresponse);
if want display string in textview sure set android:lines 2 or greater.
<textview android:id="@+id/txttitlevalue" android:text="line1: \n-line2\n-line3" android:layout_width="54dip" android:layout_height="fill_parent" android:lines="2" android:textsize="11px" />
Comments
Post a Comment