I have a TextView and I want to add a bullet symbol in my text through XML. Is it possible?
Pleas help
I have a TextView and I want to add a bullet symbol in my text through XML. Is it possible?
Pleas help
You have to use the right character encoding to accomplish this effect. You could try with •
Use Html.fromHtml()
mTextSample.setText(Html.fromHtml("<li>First</li>"));
Copy paste: •. I've done it with other weird characters, such as ◄ and ►.
Edit: here's an example. The two Button
s at the bottom have android:text="◄"
and "►"
.
Prolly a better solution out there somewhere, but this is what I did.
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TableRow>
<TextView
android:layout_column="1"
android:text="•"></TextView>
<TextView
android:layout_column="2"
android:layout_width="wrap_content"
android:text="First line"></TextView>
</TableRow>
<TableRow>
<TextView
android:layout_column="1"
android:text="•"></TextView>
<TextView
android:layout_column="2"
android:layout_width="wrap_content"
android:text="Second line"></TextView>
</TableRow>
</TableLayout>
It works like you want, but a workaround really.