java.lang.StackOverflowError 在 android 4.0 中而不是在 android 3.0 中

发布于 2025-01-01 07:26:08 字数 7464 浏览 0 评论 0原文

01-31 12:52:53.020: E/AndroidRuntime(10957): FATAL EXCEPTION: main
01-31 12:52:53.020: E/AndroidRuntime(10957): java.lang.StackOverflowError
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.graphics.Paint.getTextRunAdvances(Paint.java:1711)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.TextLine.handleText(TextLine.java:749)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.TextLine.handleRun(TextLine.java:972)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.TextLine.measureRun(TextLine.java:416)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.TextLine.measure(TextLine.java:295)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.TextLine.metrics(TextLine.java:269)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.Layout.getLineExtent(Layout.java:942)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.Layout.draw(Layout.java:405)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.BoringLayout.draw(BoringLayout.java:400)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.widget.TextView.onDraw(TextView.java:5038)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.View.draw(View.java:10978)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2887)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.widget.AbsListView.dispatchDraw(AbsListView.java:2092)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.View.draw(View.java:11083)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.widget.AbsListView.draw(AbsListView.java:3398)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2887)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.View.draw(View.java:11083)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.widget.FrameLayout.draw(FrameLayout.java:450)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.widget.ScrollView.draw(ScrollView.java:1524)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2887)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.View.draw(View.java:10981)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2887)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.View.draw(View.java:10981)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.widget.FrameLayout.draw(FrameLayout.java:450)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2887)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.View.draw(View.java:10981)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2887)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(Vi
01-31 12:52:53.020: E/AndroidRuntime(10957): FATAL EXCEPTION: main
01-31 12:52:53.020: E/AndroidRuntime(10957): java.lang.StackOverflowError
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.graphics.Paint.getTextRunAdvances(Paint.java:1711)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.TextLine.handleText(TextLine.java:749)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.TextLine.handleRun(TextLine.java:972)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.TextLine.measureRun(TextLine.java:416)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.TextLine.measure(TextLine.java:295)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.TextLine.metrics(TextLine.java:269)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.Layout.getLineExtent(Layout.java:942)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.Layout.draw(Layout.java:405)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.text.BoringLayout.draw(BoringLayout.java:400)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.widget.TextView.onDraw(TextView.java:5038)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.View.draw(View.java:10978)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2887)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.widget.AbsListView.dispatchDraw(AbsListView.java:2092)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.View.draw(View.java:11083)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.widget.AbsListView.draw(AbsListView.java:3398)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2887)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.View.draw(View.java:11083)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.widget.FrameLayout.draw(FrameLayout.java:450)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.widget.ScrollView.draw(ScrollView.java:1524)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2887)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.View.draw(View.java:10981)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2887)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.View.draw(View.java:10981)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.widget.FrameLayout.draw(FrameLayout.java:450)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2887)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2885)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.View.draw(View.java:10981)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(ViewGroup.java:2887)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489)
01-31 12:52:53.020: E/AndroidRuntime(10957):    at android.view.ViewGroup.drawChild(Vi

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

土豪 2025-01-08 07:26:08

该堆栈与有太多嵌套布局时获得的堆栈非常相似。我会运行layoutopt,看看你是否可以减少布局层次结构,看看它是否可以修复它,至于框架差异,我不能说他们是否减少了这个限制,或者较新的控件是否增加了其内部层次结构布局,从而使你超出了限制。很难说...

https://developer.android.com/studio/工具/帮助/layoutopt.html

This stack is VERY similar to the stack you get when you have too many nested Layouts. I would run layoutopt and see if you can reduce your layout hierarchy and see if it fixes it, as for Framework differences I can't say if they reduced this limit or if the newer controls increase their internal hierarchy layouts which pushed you over the limits. Hard to say...

https://developer.android.com/studio/tools/help/layoutopt.html

会傲 2025-01-08 07:26:08

当我尝试在两个 EditText 上使用 TextWatchers 时发生此错误。

这个想法是,如果一个 EditText 被更改,另一个应该设置为“”,反之亦然。

但问题是我认为它提出了一个循环,因为将另一个设置为“”也是改变,这意味着第一个也应该设置为“”等等......

This error happend to when i was trying to use TextWatchers on two EditTexts.

The idea was if one EditText was changed the other should be set to "" and vice versa.

But the problem is i think that it presented a loop since setting the other to "" is also change and it would mean the first one should also be set to "" and so on and so on...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文