我正在尝试为跨区字符串添加颜色,但颜色不适用。它显示相同的颜色
作为文本视图颜色。我写的代码。
TextView desc2=(TextView)listrow.findViewById(R.id.desc222);
desc2.setText(Html.fromHtml("<font color='#811c1d'><b>MyText</b></font> ").toString());
如果我删除“toString()”它会抛出
04-24 06:20:58.750: E/AndroidRuntime(309): java.lang.StackOverflowError
04-24 06:20:58.750: E/AndroidRuntime(309): at java.lang.reflect.Array.newInstance(Array.java:473)
04-24 06:20:58.750: E/AndroidRuntime(309): at android.text.SpannableStringInternal.getSpans(SpannableStringInternal.java:243)
04-24 06:20:58.750: E/AndroidRuntime(309): at android.text.Styled.drawUniformRun(Styled.java:61)
04-24 06:20:58.750: E/AndroidRuntime(309): at android.text.Styled.drawDirectionalRun(Styled.java:298)
04-24 06:20:58.750: E/AndroidRuntime(309): at android.text.Styled.drawText(Styled.java:357)
04-24 06:20:58.750: E/AndroidRuntime(309): at android.text.Layout.drawText(Layout.java:1387)
04-24 06:20:58.750: E/AndroidRuntime(309): at android.text.Layout.draw(Layout.java:370)
04-24 06:20:58.750: E/AndroidRuntime(309): at android.text.BoringLayout.draw(BoringLayout.java:365)
04-24 06:20:58.750: E/AndroidRuntime(309): at android.widget.TextView.onDraw(TextView.java:4050)
04-24 06:20:58.750: E/AndroidRuntime(309): at android.view.View.draw(View.java:6740)
谁能告诉我问题是什么