Android layout too deep caused by java.lang.StackOverflowError

Source: Internet
Author: User

E/androidruntime (1900): Java.lang.StackOverflowError
E/androidruntime (1900): at Android.graphics.Canvas.drawText (canvas.java:1269)
E/androidruntime (1900): at Android.text.Layout.draw (layout.java:337)
E/androidruntime (1900): at Android.widget.TextView.onDraw (textview.java:4006)
E/androidruntime (1900): at Android.view.View.draw (view.java:6057)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1545)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1543)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1543)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.View.draw (view.java:6060)
E/androidruntime (1900): at Android.view.View.buildDrawingCache (view.java:5823)
E/androidruntime (1900): at Android.view.View.getDrawingCache (view.java:5661)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1481)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.widget.AbsListView.dispatchDraw (abslistview.java:1322)
E/androidruntime (1900): at Android.widget.ListView.dispatchDraw (listview.java:2841)
E/androidruntime (1900): at Android.view.View.draw (view.java:6164)
E/androidruntime (1900): at Android.widget.AbsListView.draw (abslistview.java:2169)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1545)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1543)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1543)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1543)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1543)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1543)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1543)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1543)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1543)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.View.draw (view.java:6060)
E/androidruntime (1900): at Android.widget.FrameLayout.draw (framelayout.java:352)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1545)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.ViewGroup.drawChild (viewgroup.java:1543)
E/androidruntime (1900): at Android.view.ViewGroup.dispatchDraw (viewgroup.java:1281)
E/androidruntime (1900): at Android.view.View.draw (view.java:6060)
E/androidruntime (1900): at Android.widget.FrameLayout.draw (framelayout.java:352)
E/androidruntime (1900): at Com.android.internal.policy.impl.phonewindow$decorview.draw (PhoneWindow.java:2038)
E/androidruntime (1900): at Android.view.ViewRoot.draw (viewroot.java:1233)
E/androidruntime (1900): at Android.view.ViewRoot.performTraversals (viewroot.java:1042)
E/androidruntime (1900): at Android.view.ViewRoot.handleMessage (viewroot.java:1502)
E/androidruntime (1900): at Android.os.Handler.dispatchMessage (handler.java:99)
E/androidruntime (1900): at Android.os.Looper.loop (looper.java:123)
E/androidruntime (1900): at Android.app.ActivityThread.main (activitythread.java:3972)
E/androidruntime (1900): At Java.lang.reflect.Method.invokeNative (Native Method)
E/androidruntime (1900): at Java.lang.reflect.Method.invoke (method.java:521)
E/androidruntime (1900): at Com.android.internal.os.zygoteinit$methodandargscaller.run (ZygoteInit.java:793)
E/androidruntime (1900): at Com.android.internal.os.ZygoteInit.main (zygoteinit.java:543)
E/androidruntime (1900): At Dalvik.system.NativeStart.main (Native Method)
I/process (833): Sending signal. pid:1900 Sig:3

WORKAROUND: Reduce the number of nesting layers in the layout, especially when using a tabhost,viewpager-like control, consider the bottom-level activity

Contentview layout, as simple as possible, multi-use relativelayout replacement LinearLayout

As well as optimizing the sliding efficiency of the list, simplifying the item layout can also lead to a huge experience boost.

Android layout too deep caused by java.lang.StackOverflowError

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.