I am also experiencing this problem in my view hierarchy. I have a somewhat complex arrangement of views underneath a TabHost that end up being maybe 6 - 9 layers deep. If I remove just a single layer anywhere in the view hierarchy, the problem disappears.
I am at a loss for a work-around to continue designing my app without intentionally removing features to reduce the complexity of my view. On Mar 16, 9:50 pm, Michael Johnston <[EMAIL PROTECTED]> wrote: > I've been getting stack overflow errors when using nested ViewGroups > that are several layers deep. My groups aren't recursively defined > and the max depth I'm using is about 6. Depending on the > configuration of the nested groups, the overflow can happen: when > changing tabs, when scrolling, or when you first start to type text in > an edit box. There's evidence to suggest that other people have > encountered this problem > too:http://groups.google.com/group/android-beginners/browse_thread/thread... > > The above thread talks about nested TabHosts. I'm using a TabHost in > a ViewFlipper (along with some RelativeLayouts and LinearLayouts). > The stack trace isn't very helpful but I've included the top of it > below. Is the overflow perhaps caused by the drawing cache added in > rc14? I noticed that buildDrawingCache() calls draw(), which seems to > be the only obvious potential source of infinite recursion. I tried > disabling the cache, but I'm not entirely sure when to disable it, how > to disable it (there are two similar functions you can call...I've > tried both), or whether the disabling persists after you've done it > once. > > Any advice would be greatly appreciated, > Michael > > ERROR/AndroidRuntime(2246): java.lang.StackOverflowError > ERROR/AndroidRuntime(2246): at > android.text.Styled.measureText(Styled.java:294) > ERROR/AndroidRuntime(2246): at > android.text.Layout.measureText(Layout.java:1429) > ERROR/AndroidRuntime(2246): at > android.text.Layout.getLineMax(Layout.java:570) > ERROR/AndroidRuntime(2246): at > android.text.Layout.draw(Layout.java:256) > ERROR/AndroidRuntime(2246): at > android.widget.TextView.onDraw(TextView.java:1875) > ERROR/AndroidRuntime(2246): at android.view.View.draw(View.java: > 4574) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.drawChild(ViewGroup.java:1088) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.dispatchDraw(ViewGroup.java:914) > ERROR/AndroidRuntime(2246): at android.view.View.draw(View.java: > 4578) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.drawChild(ViewGroup.java:1088) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.dispatchDraw(ViewGroup.java:914) > ERROR/AndroidRuntime(2246): at android.view.View.draw(View.java: > 4578) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.drawChild(ViewGroup.java:1088) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.dispatchDraw(ViewGroup.java:914) > ERROR/AndroidRuntime(2246): at android.view.View.draw(View.java: > 4662) > ERROR/AndroidRuntime(2246): at > android.widget.FrameLayout.draw(FrameLayout.java:208) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.drawChild(ViewGroup.java:1088) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.dispatchDraw(ViewGroup.java:914) > ERROR/AndroidRuntime(2246): at android.view.View.draw(View.java: > 4550) > ERROR/AndroidRuntime(2246): at > android.widget.FrameLayout.draw(FrameLayout.java:208) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.drawChild(ViewGroup.java:1088) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.dispatchDraw(ViewGroup.java:914) > ERROR/AndroidRuntime(2246): at android.view.View.draw(View.java: > 4578) > ERROR/AndroidRuntime(2246): at > android.widget.FrameLayout.draw(FrameLayout.java:208) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.drawChild(ViewGroup.java:1088) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.dispatchDraw(ViewGroup.java:914) > ERROR/AndroidRuntime(2246): at android.view.View.draw(View.java: > 4550) > ERROR/AndroidRuntime(2246): at > android.view.View.buildDrawingCache(View.java:4514) > ERROR/AndroidRuntime(2246): at > android.view.View.getDrawingCache(View.java:4458) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.drawChild(ViewGroup.java:1058) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.dispatchDraw(ViewGroup.java:914) > ERROR/AndroidRuntime(2246): at android.view.View.draw(View.java: > 4550) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.drawChild(ViewGroup.java:1088) > ERROR/AndroidRuntime(2246): at > android.view.ViewGroup.dispatchDraw(ViewGroup.java:914) > ERROR/AndroidRuntime(2246): at android.view.View.draw(View.java: > 4550) > ERROR/AndroidRuntime(2246): at > android.widget.FrameLayout.draw(FrameLayout.java:208) > <snip> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

