java.lang.StackOverflowError 在 android 4.0 中而不是在 android 3.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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该堆栈与有太多嵌套布局时获得的堆栈非常相似。我会运行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
当我尝试在两个 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...