Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Android 6.0 Java.Lang.NoSuchMethodError with View.SetText

$
0
0

Hi, I have made a custom renderer for a Label that renders the HTML code as text.

When I try to set the formatted text this erro occurs:

Unhandled Exception:
Java.Lang.NoSuchMethodError: no static method "Landroid/text/Html;.fromHtml(Ljava/lang/String;I)Landroid/text/Spanned;" occurred

This is my piece of code:
Control.SetText(Html.FromHtml(View.Text.ToString(), FromHtmlOptions.ModeLegacy), TextView.BufferType.Spannable);

This happens only on Android 6.0, from 7.0 all works fine.

How can I solve this?
There is a workaround?

Thank you!


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>