Spanned How to use?

by John Doe » Wed, 11 Mar 2009 03:21:17 GMT


Sponsored Links
 I have looked a lot on the internet but I couldnt find anything. So
thats why I am asking it here.

While parsing an RSS I had to use Spanned class.

Spanned spanned;
spanned =  Html.fromHtml(content);

content string keeps the html content in it. when i check spanned
object during debug it really contains image urls and text strings but
how do I reach them? I read ImageGetter and getSpans on SDK but there
is no example on how to use them. Would you please help me?

--~--~---------~--~----~------------~-------~--~----~



Spanned How to use?

by Dianne Hackborn » Wed, 11 Mar 2009 05:40:04 GMT


 This function is intended to create text with style spans that you can put
into a TextView for display.  Unfortunately the underlying style span stuff
is not extensively documented, though it shouldn't be hard to figure out --
look at the various classes in android.text.style for the kinds of standard
style spans that are in the platform.  You may also want to browse the
open-source code to see how they are used.






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Spanned How to use?

by John Doe » Wed, 11 Mar 2009 19:57:56 GMT


 I am really trying hard to figure it out :( Probably it has a very
easy way to implement but I couldnt discover.

Spanned spanned;
spanned =  Html.fromHtml(content);

I am looking inside spanned and I see that all image url's and text is
properly kept. There must be a way to reach them. Can you help me to
figure it out? Can anyone?




--~--~---------~--~----~------------~-------~--~----~



Spanned How to use?

by Dianne Hackborn » Thu, 12 Mar 2009 02:16:39 GMT


 What are you trying to do?  Like I said, the main purpose of this API is to
create styled text that can be given to TextView for display.  If you want
to do your own display of that stuff, you'll need to write your own text
layout engine line TextView (or using the existing layout stuff like it
already does).

You'll really need to dig in to the code of TextView and these classes if
you want to do your own special stuff with them.








-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



Spanned How to use?

by John Doe » Thu, 12 Mar 2009 16:06:33 GMT


 ere is what I am trying to do. I am parsing an XML an inside CDDATA
tags inside <content:encoded> tags I have an html

<![CDATA[
<p> </p>
<p class="MsoNormal"><a href="http://www.androidturkiye.net/wp-content/
uploads/2009/03/ahome.jpg"><img class="alignleft size-thumbnail wp-
image-791" title="ahome" src="http://www.androidturkiye.net/wp-content/
uploads/2009/03/ahome-150x150.jpg" alt="ahome" width="150"
height="150" /></a>Gelitiricileri <a href="http://www.mappn.com/
community/">http://www.mappn.com/community/</a> olan amac Androidin
grafiksel arayzn deitirmeye yarayan ve internette birok temas
bulunan ve temalar gelitirilmeye devam eden kullanl bir
program.Size nasl kullanldn aklamaya alacam.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">ncelikle uygulamay bulmak iin android market
atktan sonra men tuuna basarak Search diyelim gelen arama blmne
ahome yazalm,karnza sadaki gibi ahome ait program ve temalar
karnza gelecektir,ahome'un 2 versiyonu mevcut biri cretli olan
biri ise free yani cretsiz olan versiyonu <strong>Ahome Lite </
strong>biz lite olann yklyoruz.Ykleme bittikten sonra program
altrmaynz , size tavsiyem ykledikten sonra cihaznz yeniden
balatrsanz sknt yaamasnz,</p>
<p class="MsoNormal">Yklendikten sonra , Ana ekrandayken Home tuuna
bir kere bastnzda karnza aadaki gibi bir seim ekran
gelecektir,aHome Lite setiimizde masast 2 blm oluyor sa ve
sol olarak.</p>
<p class="MsoNormal"><a href="http://www.androidturkiye.net/wp-content/
uploads/2009/03/ahome2.jpg"><img class="alignnone size-medium wp-
image-792" title="ahome2" src="http://www.androidturkiye.net/wp-
content/uploads/2009/03/ahome2-200x300.jpg" alt="ahome2" width="200"
height="300" /> </a><a href="http://www.androidturkiye.net/wp-
content/uploads/2009/03/ahome3.jpg"><img class="alignnone size-medium
wp-image-793" title="ahome3" src="http://www.androidturkiye.net/wp-
content/uploads/2009/03/ahome3-200x300.jpg" alt="ahome3" width="200"
height="300" /></a></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Aada grnd gibi , hava durumu ve saat
tarih ve gn gsteren bir widget geliyor.Aada soldaki Byte
iareti herzamanki program listemizi ayor, sadaki hz gstergesi
ise kullanlabilecek widgetlar listeliyor, istediginiz widgeti
silebiliyorsunuz yerini deitirebiliyorsunuz.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><a href="http://www.androidturkiye.net/wp-content/
uploads/2009/03/ahome4.jpg"><img class="alignnone size-medium wp-
image-794" title="ahome4" src="http://www.androidturkiye.net/wp-
content/uploads/2009/03/ahome4-200x300.jpg" alt="ahome4" width="200"
height="300" /> </a><a href="http://www.androidturkiye.net/wp-
content/uploads/2009/03/ahome5.jpg"><img class="alignnone size-medium
wp-image-795" title="ahome5" src="http://www.androidturkiye.net/wp-
conte



Other Threads

1. What kind of error?

I run sample notify msg box app, its result ok on Emulator, but i am
not clear following Can't dispatch DDM; please explain about that,
Thanks , Thaw

[2008-10-30 13:42:35 - Notification] Android Launch!
[2008-10-30 13:42:35 - Notification] adb is running normally.
[2008-10-30 13:42:35 - Notification] Launching:
com.example.android.apis.app.NotifyWithText
[2008-10-30 13:42:35 - Notification] Automatic Target Mode: using
existing emulator: emulator-5554
[2008-10-30 13:42:39 - Notification] Uploading Notification.apk onto
device 'emulator-5554'
[2008-10-30 13:42:41 - Notification] Installing Notification.apk...
[2008-10-30 13:43:56 - Notification] Application already exists.
Attempting to re-install instead...
[2008-10-30 13:44:12 - Notification] Success!
[2008-10-30 13:44:13 - Notification] Starting activity
com.example.android.apis.app.NotifyWithText on device
[2008-10-30 13:44:22 - Notification] ActivityManager: DDM dispatch reg
wait timeout
[2008-10-30 13:44:22 - Notification] ActivityManager: Can't dispatch
DDM chunk 52454151: no handler defined
[2008-10-30 13:44:22 - Notification] ActivityManager: Can't dispatch
DDM chunk 48454c4f: no handler defined
[2008-10-30 13:44:31 - Notification] ActivityManager: Starting: Intent
{ comp={com.example.android.apis.app/
com.example.android.apis.app.NotifyWithText} }
--~--~---------~--~----~------------~-------~--~----~

2. Google Android Team - Whats going on??

So the G1 has been out for about 2 weeks now and no updates have been
made on the Android blog regarding upcoming changes, comments on
issues people are having, nothing.  Its like they released Android to
the wild and thats it.  Whats going on??
--~--~---------~--~----~------------~-------~--~----~

3. Detecting wallpaper changed

4. SQLite Nesting Limit?

5. R.java Problem

6. bionic

7. Verify Error with HTTPMIME / MIME4J