Ok, i give up, I tried everything i could to reduce layers, but i am only as
few as 5 so far :(( Seems to me impossible to do less, see screenshot
showing my current layout
here<http://7121106850168047486-a-1802744773732722657-s-sites.googlegroups.com/site/freeboxrecorder/project-updates/version160/fbr-1.6.0-programmer.png?attachauth=ANoY7cp6uSqcBGdi7yv_N_LjNb8PoaAwQRo2RcTVa1t0fYhweE6OgZ4so6QJobafkJTg44PSz_en4RyW8vmvQ9rQF9e-yDEk5rTm4l1TfJ8FHZRna3u3Ar3A4BGXrzkn1afW0fol1xHV4gLyjZNAS4znA3zzTq6ewGYdQ0e5ul1BwYoZzMPFwtLi0rzF5h36gOnu8wXR9tnREkqvb9MowwxuCNU3qiY3t-6vpDHVky5WzfKgLk2VahKacMqe8OSW00NEz-Q9o-Bs&attredirects=0>

With 5 layers, my application crashes randomly apparently when i try to add
a background on top level layout. Even if i remove this background, i am not
sure it will not crash because of something else. I saw for instance that
getTabHost().setBackgroundColor(Color.BLACK) that i just tried in
TabActivity also engenders crashes.

My conclusion is that TabHost with activities-in-tabs is just too limited
and seeing this unpredictable behaviour i think we can consider this as a
bug.

The only valid long term solution for me is to change all my application to
views-in-tabs approach thought i will require me a lot of rework.

This huge limitation should be clearly stated in the documentation and
ApiDemos sample because it is something that really should be taken into
account before developping an application.

Thanks everybody who tried to help me on this subject.
Thierry.


2010/6/7 Mark Murphy <[email protected]>

> Thierry Legras wrote:
> > I am facing rare StackOverflowError in my application during UI redraw.
> > Does it mean memory is exhausted?
>
> It means that stack space is exhausted.
>
> > How can i fix this?
>
> Your UI probably has too many layers in its hierarchy. Run the
> hierarchyviewer program and examine the chart showing your ViewGroups
> and what they all contain. Try to eliminate some layers (e.g., replace
> nested LinearLayouts with a single RelativeLayout, get rid of
> activities-in-tabs and switch to views-in-tabs).
>
> > And finally how
> > can i be sure the issue will be definitevly fixed??
>
> My very rough rule of thumb:
>
> -- If your hierarchy has <10 layers, you should have no problem
> -- If your hierarchy has 10-14 layers, I get nervous
> -- If your hierarchy has >=15 layers, it's gonna blow up sometimes
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 2.0 Available!
>
> --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en




-- 
Thierry.

-- 
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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to