I am getting the below error While trying to Render the Text in the Text view
java.lang.RuntimeException: PARAGRAPH span must start at paragraph boundary (46 follows )
at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:161)
at android.text.SpannableStringInternal.copySpans(SpannableStringInternal.java:67)
at android.text.SpannableStringInternal.<init>(SpannableStringInternal.java:42)
at android.text.SpannedString.<init>(SpannedString.java:30)
at android.text.method.ReplacementTransformationMethod.getTransformation(ReplacementTransformationMethod.java:83)
at android.widget.TextView.setText(TextView.java:4436)
at android.widget.TextView.setText(TextView.java:4332)
at android.widget.TextView.setText(TextView.java:4307)
I am calling like
myAsyncTask().execute(source, listDrawable, textView.getContext());
return listDrawable;
}
}, new MyTagHandler());
textView.setText(htmlText);
Can anyone Help me in this to sort the above issue
You're probably using the function Html.fromHtml(String source)
, which has been changed for Android SDK API >= 24 (Anrdroid 7.0)
, to get your Spannable for textView.setText(htmlText)
, so the resulting Spannable now differs a bit. Because of that, it won't fit to old deprecated functions/attributes anymore.
Therefore, you have three options to solve your problem:
android:singleLine=true
in your list element use android:maxLines="1"
instead.loadDataWithBaseURL(...)
to resolve your problem, but then you have to use a webview, which could be a big overload for a list element.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With