Skip to content
Advertisement

Android: how to give bulletpoints, line break to text in textview

i have a textview with large text in it, but i want to give bulletpoints, line breaks , i tried placing xml entities like &#8226 for bullet point in my string.xml, but unable to get linebreak and few text comes in the middle, i like to use justify too

String nodata="hi how are you<br/>&#8226welcome to stackoverflow"  
TextView nodata= ((TextView) findViewById(R.id.nodata));
nodata.setText(Html.fromHtml(nodatafound));    

it kind of works but I am unable to use justify , is there any way I can achieve this?

Advertisement

Answer

Thank you all…i finally ended up doing this

String nodata="hi how are you<br/>•welcome to stackoverflow"
TextView nodata= ((TextView) findViewById(R.id.nodata));
nodata.setText(Html.fromHtml(nodatafound)); 

and for justify left i did change in my layout file android:layout_gravity=center|left

i hope there is a betterway doing this.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement