ufo22940268 / android-justifiedtextview

android justified textview
951 stars 243 forks source link

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

Open ganghuaChen opened 9 years ago

ganghuaChen commented 9 years ago

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)

theangi commented 8 years ago

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

malachid commented 8 years ago

In the onDraw method, changing

String text = getText();

to

String text = getText().toString();

seems to fix it.

Magenta94 commented 7 years ago

Same problem, please release a fixed version.

ointeractive-depot commented 5 years ago

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

Nordis1 commented 3 years ago

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