views:

336

answers:

4

I have a TextView and I want to add a bullet symbol in my text through XML. Is it possible?

Pleas help

A: 

You have to use the right character encoding to accomplish this effect. You could try with •

BennySkogberg
A: 

Use Html.fromHtml()

mTextSample.setText(Html.fromHtml("<li>First</li>"));
st0le
This doesn't work for me.
Satoru.Logic
Negative - this does nothing
DroidIn.net
+2  A: 

Copy paste: •. I've done it with other weird characters, such as ◄ and ►.

Edit: here's an example. The two Buttons at the bottom have android:text="◄" and "►".

Felix
The problem is when line wraps. It will not indent a 2nd line
DroidIn.net
+1  A: 

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.

The Cageybee