码迷,mamicode.com
首页 > 移动开发 > 详细

Android java.lang.StackOverflowError at android.view.ViewGroup.drawChild(ViewGroup.java:2666)

时间:2015-01-28 18:04:58      阅读:305      评论:0      收藏:0      [点我收藏+]

标签:android   exception   

技术分享



做这样一个页面,下面有五个页签,滑动,有数据显示listview,无数据显示动画,开始我看到他们好多东西是相同的,就提取出来,用include包含布局文件:

结果报一下错误:


01-28 11:27:36.593: E/AndroidRuntime(16182): FATAL EXCEPTION: main
01-28 11:27:36.593: E/AndroidRuntime(16182): java.lang.StackOverflowError
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2666)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.draw(View.java:11100)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10536)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.draw(View.java:11100)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10536)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.draw(View.java:11100)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.widget.FrameLayout.draw(FrameLayout.java:450)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.widget.ScrollView.draw(ScrollView.java:1939)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10536)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.draw(View.java:11100)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10536)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.draw(View.java:11100)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.support.v4.view.ViewPager.draw(ViewPager.java:2171)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10536)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.draw(View.java:11100)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10536)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.draw(View.java:11100)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10536)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2503)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.View.getDisplayList(View.java:10534)
01-28 11:27:36.593: E/AndroidRuntime(16182): at android.view.ViewGroup.drawChild(ViewGroup.java:2864)


开始一直没找到原因,因为没有明确说哪里报错。那个类,那个控件之类的。后来发现是嵌套的层次太深了。一个xml里面包含include,里面的xml还包含include,后台勉为其难,都放到一个xml文件,就ok了!



Android java.lang.StackOverflowError at android.view.ViewGroup.drawChild(ViewGroup.java:2666)

标签:android   exception   

原文地址:http://blog.csdn.net/lengguoxing/article/details/43231947

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!