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 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

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

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

<p> </p>
<p class="MsoNormal"><a href="
uploads/2009/03/ahome.jpg"><img class="alignleft size-thumbnail wp-
image-791" title="ahome" src="
uploads/2009/03/ahome-150x150.jpg" alt="ahome" width="150"
height="150" /></a>Gelitiricileri <a href="
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="
uploads/2009/03/ahome2.jpg"><img class="alignnone size-medium wp-
image-792" title="ahome2" src="
content/uploads/2009/03/ahome2-200x300.jpg" alt="ahome2" width="200"
height="300" /> </a><a href="
content/uploads/2009/03/ahome3.jpg"><img class="alignnone size-medium
wp-image-793" title="ahome3" src="
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="
uploads/2009/03/ahome4.jpg"><img class="alignnone size-medium wp-
image-794" title="ahome4" src="
content/uploads/2009/03/ahome4-200x300.jpg" alt="ahome4" width="200"
height="300" /> </a><a href="
content/uploads/2009/03/ahome5.jpg"><img class="alignnone size-medium
wp-image-795" title="ahome5" src="

Other Threads

1. Ringtone.stop() wont work?

I currently start a Ringtone on Android and it plays fine.

However when I try to stop the ringtone it doesn't stop or atleast
doesn't stop straight away, it will keep in playing until it just
plays out.

Here is how I set up the Ringtone:

int rm = audio_service.getRingerMode();
int vs =

android.os.{*filter*} v = ({*filter*})

if ((rm == AudioManager.RINGER_MODE_VIBRATE ||
    (rm == AudioManager.RINGER_MODE_NORMAL && vs ==

if (audio_service.getStreamVolume(AudioManager.STREAM_RING) > 0)

    oRingtone = RingtoneManager.getRingtone(this,


And here is how I try to stop it

if (CallDialogActivity.oRingtone != null) {
      Log.d("RINGTONE", "Into Ringtone if");
      Ringtone ringtone = CallDialogActivity.oRingtone;
      oRingtone = null;

Has anyone come across similiar problems or see any mistakes in my


2. AudioTrack.getPlaybackHeadPosi tion() is buggy????


does anybody use AudioTrack.getPlaybackHeadPosition()?
i found that, if i call AudioTrack.pause() in the middle of playing
audio frames, at end of playback getPlaybackHeadPosition() always
returns hundreds of frames less than the number of frames fed into
AudioTrack object .

did anybody also run into the same issue?

if you did, how did you work around this unexpected behavior?

thank u~


3. is it possible to get user name against the default Gmail account.

4. intercept sms

5. K9 2510 (was WTA : Push Yahoomail)

6. Save File via Gmail di Androi

7. USB mass storage issue in Eclair