How to fill paricular portion of text content with chosen color

by Archana » Wed, 25 Nov 2009 13:53:14 GMT

Sponsored Links
Thanks this link is really useful for me..But i am facing 1 problem
i tried in this way..

TextView text;

Spannable str = (Spannable) text.getText();

str.setSpan(new BackgroundColorSpan(0xFFFFFF00), 3, 12,

its working fine.But i dont want to set start point and end point as
(3,12).I want to get the length when i click

mouse on particular position in text.

I used event.getx() and getY(),But this will return screen cursor
position only.How can i get length dyanmically ?


How to fill paricular portion of text content with chosen color

by Dexter's Brain » Fri, 27 Nov 2009 15:54:32 GMT

 Well, for a textview, you cannot fetch the characters on which the
mouse is residing. I would recommend to use an uun-editable EditText
and the ask the user to first select some text from the Edit Text.

Now, EditText have methods, to let you know what is the start of
selection , and the end of selection.

I guess, I am clear enough.



Sponsored Links

How to fill paricular portion of text content with chosen color

by skink » Fri, 27 Nov 2009 20:26:00 GMT


yes, you can

see docs about text layouts



Other Threads

1. Android & voip


ada yang pernah pake aplikasi talkonaut yang ada di market? Gimana
reviewnya, bagus gak? Daripada nunggu google voice yang belum bisa masuk ke
Indonesia , mending coba aplikasi ini.

Katanya sih bisa voip lewat protokol gtalk , tapi saya sendiri belum bisa
coba karena belum ada lawan bicaranya. Kalo ada yang nganggur en mau coba,
add gw ya di gtalk terus nanti telp gw pake talkonaut ini


sent from magix donut

Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to

To request to subscribe to this group:


2. Reference external lib resources?

That is not possible, insofar as Android resources cannot be contained
in JAR files.

Mark Murphy (a Commons Guy) |

Android App Developer Books:


3. Selector with the ImageView?

4. Rotate TextView 90 degrees text out of view.

5. start activity without mention in androidmanifestfile

6. How to test if app is shown on Market for all screensizes

7. Beda magic dan hero