android-justifiedtextview icon indicating copy to clipboard operation
android-justifiedtextview copied to clipboard

android.text.SpannedString cannot be cast to java.lang.String

Open ganghuaChen opened this issue 10 years ago • 5 comments
trafficstars

Process: com.zhongduomei.rrmj.society, PID: 23335 java.lang.ClassCastException: android.text.SpannedString cannot be cast to java.lang.String at me.biubiubiu.justifytext.library.JustifyTextView.onDraw(JustifyTextView.java:34) at android.view.View.draw(View.java:14493) at android.view.View.getDisplayList(View.java:13390)

ganghuaChen avatar Jun 17 '15 06:06 ganghuaChen

I'm having the same issue, when setting the text with Html.fromHtml() which returns a Spannable object

theangi avatar Sep 12 '15 11:09 theangi

In the onDraw method, changing

String text = getText();

to

String text = getText().toString();

seems to fix it.

malachid avatar Sep 17 '15 17:09 malachid

Same problem, please release a fixed version.

Magenta94 avatar Nov 11 '16 20:11 Magenta94

Don't believe that the problem don't fixed yet(

ointeractive-depot avatar Aug 12 '18 21:08 ointeractive-depot

Learn thathttps://www.infopalacess.com/2019/04/justify-text-in-android-studio.html There is helpful info.

Nordis1 avatar May 22 '21 15:05 Nordis1