How to fill paricular portion of text content with chosen color

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


Sponsored Links
 Hi..
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,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

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.

Thanks,
Dexter.

--


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

pskink

--



Other Threads

1. Koran Kompas di androi

Hi android lover yang terhormat,
Saya ingin berbagi aplikasi android buatan saya sendiri dengan anda.
Aplikasi ini di kembangkan karena saya tidak menemukan aplikasi kompas pada
android kesayangan saya, sedangkan untuk membaca langsung dari website nya
saya rasa kurang nyaman.

Screenshot :
http://u.kaskus.us/43/lueosbbi.jpg
http://u.kaskus.us/43/ib7unlat.jpg

Cara Download aplikasi :
1. Buka android market
2. ketik "Kompas"
3. Klik Install


Mudah mudahan berkenan, dan jangan lupa di rate serta comment nya yah

Makasih

-- 
===============
"Indonesian Android Community [id-android]"

PING'S mobile
Email: sa...@pings-mobile.com  Ph. (021) 96087100
---------------------
Yopie Ratjoen
Email: yo...@ratjoen.com  Ph. 08977726681
--------------------
Gila original
Email: i...@gilaoriginal.com  Ph. (031) 91555898
--------------------

Aturan Jual/Kloteran ID-Android  http://goo.gl/azW7

2. Opera mobile 10.1 beta Android

http://m.opera.com/next/

..:: the epic android is indahouse ::..

-- 
===============
"Indonesian Android Community [id-android]"

PING'S mobile
Email: sa...@pings-mobile.com  Ph. (021) 96087100
---------------------
Yopie Ratjoen
Email: yo...@ratjoen.com  Ph. 08977726681
--------------------
Gila original
Email: i...@gilaoriginal.com  Ph. (031) 91555898
--------------------

Aturan Jual/Kloteran ID-Android  http://goo.gl/azW7

3. angry birds

4. OOT: Paging Androiders Palembang

5. ARCHOS 101 internet tablet

6. Tanya : upgrade desire official froyo

7. Stop AlarmManager sending past repeating alarm.