StackOverflow exeption in Fragments
<p>I have a tabhost with 5 tabs which are FragmentActivity. One of them contains a sequence of 7 views. I think that each is a fragment, but when I get to fragment 7 the app explodes.</p>

<p><img src="http://i.stack.imgur.com/C2iP8.png" alt="enter image description here"></p>

<p><img src="http://i.stack.imgur.com/ThBp2.png" alt="enter image description here"></p>

<p>When i press the continue button in each fragment I start a new fragment in this way:</p>

<pre><code>   MyFragment newFragment = new MyFragment ();
    FragmentTransaction transaction = getFragmentManager().beginTransaction();
    transaction.replace(R.id.publish_map_direction, newFragment);
    transaction.addToBackStack(null);
    transaction.commit();
</code></pre>

<p>This is the error:</p>

<pre><code>11-14 13:50:33.640: I/dalvikvm(13823): threadid=1: stack overflow on call to Landroid/text/Layout;.draw:VLLLI
11-14 13:50:33.640: I/dalvikvm(13823):   method requires 288+20+60=368 bytes, fp is 0x4428a42c (300 left)
11-14 13:50:33.640: I/dalvikvm(13823):   expanding stack end (0x4428a300 to 0x4428a000)
11-14 13:50:33.640: I/dalvikvm(13823): Shrank stack (to 0x4428a300, curFrame is 0x4428cc74)
11-14 13:50:33.640: D/AndroidRuntime(13823): Shutting down VM
11-14 13:50:33.640: W/dalvikvm(13823): threadid=1: thread exiting with uncaught exception (group=0x40015578)
11-14 13:50:33.703: E/AndroidRuntime(13823): FATAL EXCEPTION: main
11-14 13:50:33.703: E/AndroidRuntime(13823): java.lang.StackOverflowError
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.widget.TextView.onDraw(TextView.java:4229)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6933)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6936)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6936)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.buildDrawingCache(View.java:6695)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.onAnimationStart(ViewGroup.java:1259)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1505)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6936)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6936)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6936)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6936)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6936)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6936)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.widget.FrameLayout.draw(FrameLayout.java:357)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6936)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6936)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.widget.FrameLayout.draw(FrameLayout.java:357)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6936)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.widget.FrameLayout.draw(FrameLayout.java:357)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.View.draw(View.java:6936)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.widget.FrameLayout.draw(FrameLayout.java:357)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1904)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewRoot.draw(ViewRoot.java:1527)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewRoot.performTraversals(ViewRoot.java:1263)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.view.ViewRoot.handleMessage(ViewRoot.java:1865)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.os.Handler.dispatchMessage(Handler.java:99)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.os.Looper.loop(Looper.java:130)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at android.app.ActivityThread.main(ActivityThread.java:3687)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at java.lang.reflect.Method.invokeNative(Native Method)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at java.lang.reflect.Method.invoke(Method.java:507)
11-14 13:50:33.703: E/AndroidRuntime(13823):    at com.
</code></pre>

<p>Should I structure my app in a different way? </p>
