android.graphics.Text.setPaint中的ArrayIndexOutOfBoundsException

时间:2012-07-18 21:09:44

标签: android

我从Android市场报告中得到了这个疯狂的例外。它每周发生4-6次(我们有超过10万的用户群)。我将代码片段附加到堆栈下。我甚至找不到Text.java源代码。

java.lang.ArrayIndexOutOfBoundsException: result:3
at android.graphics.Text.setPaint(Native Method)
at android.graphics.Text.setPaint(Text.java:211)
at android.text.Layout.each(Layout.java:350)
at android.text.Layout.decorateText(Layout.java:312)
at android.text.Layout.reflow(Layout.java:410)
at android.text.Layout.reflowFull(Layout.java:369)
at android.text.StaticLayout.<init>(StaticLayout.java:114)
at android.text.StaticLayout.<init>(StaticLayout.java:67)
at android.text.StaticLayout.<init>(StaticLayout.java:51)
at android.widget.TextView.makeNewLayout(TextView.java:5315)
at android.widget.TextView.checkForRelayout(TextView.java:5765)
at android.widget.TextView.setText(TextView.java:2781)
at android.widget.TextView.setText(TextView.java:2649)
at android.widget.TextView.setText(TextView.java:2624)
at com.soakmein.MessageListView$StreamAdapter.getView(MessageListView.java:1042)
at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220)
at android.widget.AbsListView.obtainView(AbsListView.java:1498)
at android.widget.ListView.makeAndAddView(ListView.java:1749)
at android.widget.ListView.fillUp(ListView.java:704)
at android.widget.ListView.fillGap(ListView.java:650)
at android.widget.AbsListView.trackMotionScroll(AbsListView.java:3521)
at android.widget.AbsListView.onTouchEvent(AbsListView.java:2339)
at android.widget.ListView.onTouchEvent(ListView.java:3447)
at android.view.View.dispatchTouchEvent(View.java:3952)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:995)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1034)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1034)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1034)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1034)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1711)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1145)
at android.app.Activity.dispatchTouchEvent(Activity.java:2096)

这是解雇激活的行:

messageText.setText(Html.fromHtml(text));

1 个答案:

答案 0 :(得分:0)

也许你可以发布源代码。

除此之外,我建议你浏览堆栈,直到找到出现越界错误的行。

您可能正在使用变量来跟踪数组的索引,并且该变量不受与数组具有相同边界的规则的限制。