This looks like a bug to me.  Under SDK 1.5 this code:

        String lineSeparator = System.getProperty
( "line.separator" );
        String testString = "first line"+lineSeparator+"second line";
        Log.i("helloworld15","testString.indexOf(lineSeparator))
"+testString.indexOf(lineSeparator));
        Spanned spanned = Html.fromHtml(testString);
        Log.i("helloworld15","spanned.toString().indexOf
(lineSeparator)) "+spanned.toString().indexOf(lineSeparator));

ouputs:

06-02 21:57:46.255: INFO/helloworld15(1210): testString.indexOf
(lineSeparator)) 10
06-02 21:57:46.284: INFO/helloworld15(1210): spanned.toString().indexOf
(lineSeparator)) -1


Under SDK 1.1 it output:

06-02 21:58:38.176: INFO/helloworld15(471): testString.indexOf
(lineSeparator)) 10
06-02 21:58:38.715: INFO/helloworld15(471): spanned.toString().indexOf
(lineSeparator)) 10

So it appears that as of SDK 1.5 Html.fromHtml is stripping out
lineSeparators.

This is also true for the method:

fromHtml(String source, Html.ImageGetter imageGetter, Html.TagHandler
tagHandler)

for reference here is the Android Html class:
http://developer.android.com/reference/android/text/Html.html
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to