Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>On Android 4 everything is fine</p> </blockquote> <p>No, you just haven't crashed yet. I am not aware that they increased the stack size on Android 4.x. They may have made some widgets a bit more efficient, which is allowing you to survive a bit longer, for some operations.</p> <blockquote> <p>This is a problem because the large number of views is due to me using the support library and fragments for tabs - which is the recommended approach</p> </blockquote> <p>You are welcome to use ordinary <code>Views</code> in tabs, whether those tabs are from <code>ViewPager</code> (and a suitable indicator), the action bar, or even the ancient <code>TabHost</code>. Fragments are not required.</p> <blockquote> <p>I'm looking for ways to increase the stack size of the UI thread</p> </blockquote> <p>This is not possible except by modifying the Android framework and forcing ~800 million Android device users at gunpoint to root their phones and replace their framework. Even if it were possible, unless you are in position to test on hundreds of devices, you will have no idea if your hack will be stable.</p> <blockquote> <p>Anyways, being at 15 is still too much on the edge.. especially when nobody can tell exactly where the edge lies</p> </blockquote> <p>The "edge" is 8KB of stack space, if I remember the figure correctly. Talented programmers realize that you cannot express the "edge" precisely in terms of the number of nested views in the hierarchy, as stack consumption will vary based on operations being performed and OS level.</p> <blockquote> <p>I've seen so many people stuck with the same problem</p> </blockquote> <p>You have a rather low value for "so many". This hasn't been a significant problem in years, based on questions asked in public support areas.</p> <blockquote> <p>The tab fragment activity from the support library takes 5 views by itself.</p> </blockquote> <p>Since there is nothing in Android named a "tab fragment activity", we cannot help you much with this, other than to suggest using another source of tabs. For example, <code>ViewPager</code> with <code>TabPagerIndicator</code> (from <a href="http://viewpagerindicator.com/" rel="nofollow">ViewPagerIndicator</a>) should be around two nested levels along the critical path.</p> <blockquote> <p>Then every fragment is at least 4.</p> </blockquote> <p>Talented programmers realize that fragments do not even need to <em>have</em> views, and so the minimum number of views for a fragment is 0. Talented programmers also realize that fragments that do have a UI need a minimum of 1 view, not 4, because you can return any <code>View</code> you want from <code>onCreateView()</code> -- there is nothing in the semantics of <code>onCreateView()</code> that requires 4.</p> <p>For example, <a href="https://github.com/commonsguy/cw-omnibus/tree/master/ViewPager/VPI" rel="nofollow">this sample project</a> uses a <code>ViewPager</code> with <code>TabPagerIndicator</code> and fragments for the tabs. From root to critical-path leaf, the entire structure has 7 levels.</p> <blockquote> <p>Having 10 views in my personal hierarchy is nothing extraordinary</p> </blockquote> <p>Yes, it is, once you add the 3 levels intrinsic to all activities, as 13 levels definitely start to make me nervous. In my cited example, <code>ViewPager</code>, its tabs, and the fragments add 4 levels on top of that. If you are saying that you want to have 10 levels of hierarchy in a tab, I doubt that there is a tab solution slim enough for that, though action bar tabs are one possibility.</p> <p>Hence, your solution is:</p> <ul> <li>Simplify your 10-level per-tab hierarchy</li> <li>If that alone is insufficient, choose a slimmer tab implementation</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload