error in groupactivity of tabactivity in android
<p>I had developed group activity with in a tab activity. after some time iam getting stack overflow error after clicking some back button for 5times..until 5 times it is working properly. after that getting error.can any one help me..it is something like this button>click to next page in that back button&lt; should redirect to previous page.in that iam showing tab-activity at the bottom of the screen with three tabs..i am able to show the tabs but getting stack over flow error.can any one help me please...
this is stack trace</p>

<pre><code>01-24 12:02:02.020: D/History_grapview(379): Calendar Instance:= Month: January 
01-24 12:05:59.020: I/dalvikvm(379): threadid=1: stack overflow on call to Landroid/text/Styled;.measureText:FLLLIIL
01-24 12:05:59.020: I/dalvikvm(379):   method requires 80+20+56=156 bytes, fp is 0x418fa394 (148 left)
01-24 12:05:59.029: I/dalvikvm(379):   expanding stack end (0x418fa300 to 0x418fa000)
01-24 12:05:59.029: I/dalvikvm(379): Shrank stack (to 0x418fa300, curFrame is 0x418fcc74)
01-24 12:05:59.040: D/AndroidRuntime(379): Shutting down VM
01-24 12:05:59.050: W/dalvikvm(379): threadid=1: thread exiting with uncaught exception (group=0x40015560)
01-24 12:05:59.090: E/AndroidRuntime(379): FATAL EXCEPTION: main
01-24 12:05:59.090: E/AndroidRuntime(379): java.lang.StackOverflowError
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.text.Layout.measureText(Layout.java:1655)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.text.Layout.getLineMax(Layout.java:689)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.text.Layout.draw(Layout.java:340)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.text.BoringLayout.draw(BoringLayout.java:365)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.widget.TextView.onDraw(TextView.java:4170)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.View.draw(View.java:6880)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.View.draw(View.java:6883)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.View.draw(View.java:6883)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.View.draw(View.java:6883)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.View.draw(View.java:6883)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.View.draw(View.java:6883)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.View.draw(View.java:6883)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.View.draw(View.java:6883)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.View.draw(View.java:6883)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.View.draw(View.java:6883)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.widget.FrameLayout.draw(FrameLayout.java:357)
01-24 12:05:59.090: E/AndroidRuntime(379):  at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1862)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewRoot.draw(ViewRoot.java:1522)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewRoot.performTraversals(ViewRoot.java:1258)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)
01-24 12:05:59.090: E/AndroidRuntime(379):  at android.os.Handler.dispatc
01-24 12:06:00.399: I/Process(379): Sending signal. PID: 379 SIG: 9
01-24 12:34:56.109: D/History_grapview(391): Calendar Instance:= Month: January 
01-24 12:35:00.720: D/PhoneWindow(391): couldn't save which view has focus because the focused view com.android.internal.policy.impl.PhoneWindow$DecorView@4053d9b0 has no id.
01-24 12:35:00.770: W/dalvikvm(391): No implementation found for native Lcom/google/android/maps/MapActivity;.onCreate (Landroid/os/Bundle;)V
01-24 12:35:00.770: D/AndroidRuntime(391): Shutting down VM
01-24 12:35:00.779: W/dalvikvm(391): threadid=1: thread exiting with uncaught exception (group=0x40015560)
01-24 12:35:00.790: E/AndroidRuntime(391): FATAL EXCEPTION: main
01-24 12:35:00.790: E/AndroidRuntime(391): java.lang.UnsatisfiedLinkError: onCreate
01-24 12:35:00.790: E/AndroidRuntime(391):  at com.google.android.maps.MapActivity.onCreate(Native Method)
01-24 12:35:00.790: E/AndroidRuntime(391):  at com.a1technology.impak.CurrentLocation.onCreate(CurrentLocation.java:24)
01-24 12:35:00.790: E/AndroidRuntime(391):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-24 12:35:00.790: E/AndroidRuntime(391):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
01-24 12:35:00.790: E/AndroidRuntime(391):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
01-24 12:35:00.790: E/AndroidRuntime(391):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
01-24 12:35:00.790: E/AndroidRuntime(391):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
01-24 12:35:00.790: E/AndroidRuntime(391):  at android.os.Handler.dispatchMessage(Handler.java:99)
01-24 12:35:00.790: E/AndroidRuntime(391):  at android.os.Looper.loop(Looper.java:130)
01-24 12:35:00.790: E/AndroidRuntime(391):  at android.app.ActivityThread.main(ActivityThread.java:3683)
01-24 12:35:00.790: E/AndroidRuntime(391):  at java.lang.reflect.Method.invokeNative(Native Method)
01-24 12:35:00.790: E/AndroidRuntime(391):  at java.lang.reflect.Method.invoke(Method.java:507)
01-24 12:35:00.790: E/AndroidRuntime(391):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
01-24 12:35:00.790: E/AndroidRuntime(391):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-24 12:35:00.790: E/AndroidRuntime(391):  at dalvik.system.NativeStart.main(Native Method)`
</code></pre>

<p>And this is my code</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.history);
        if (stack == null)
            stack = new Stack&lt;String&gt;();
        graphview=(Button) findViewById(R.id.graphview);
        share=(Button) findViewById(R.id.share);
        topbar=(TextView) findViewById(R.id.topbar);
        impak=(TextView) findViewById(R.id.impak);

        graphview.setOnClickListener(clickListener);
        share.setOnClickListener(clickListener);

    }
    public void finishFromChild(Activity child) {
        pop();
    }

    @Override
    public void onBackPressed() {
        pop();
    }

    public void push(String id, Intent intent) {
        Window window = getLocalActivityManager().startActivity(id,
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
        if (window != null) {
            stack.push(id);
            setContentView(window.getDecorView());
        }
    }

    public void pop() {
        if (stack.size() == 1)
            finish();
        LocalActivityManager manager = getLocalActivityManager();
        manager.destroyActivity(stack.pop(), true);
        if (stack.size() &gt; 0) {
            Intent lastIntent = manager.getActivity(stack.peek()).getIntent();
            Window newWindow = manager.startActivity(stack.peek(), lastIntent);
            setContentView(newWindow.getDecorView());
        }
    }
        private  View.OnClickListener clickListener = new View.OnClickListener() {

            public void onClick(View v) {
                // TODO Auto-generated method stub



                        switch(v.getId())
                                {
                                case R.id.graphview:
                                    //Intent intent=new Intent(History.this,History_graphview.class);
                                    //startActivity(intent);
                                    push("FirstStackActivity", new Intent(History.this, History_graphview.class));

                                    break;

                                case R.id.share:
                                Intent intent=new Intent(History.this,History_share.class);
                                startActivity(intent);
                                break;
            }





case R.id.listview:
            /*  Intent intent=new Intent(History_graphview.this,History.class);
                startActivity(intent);
                finish();*/
                History h=(History)getParent();
                h.push("",new Intent(History_graphview.this, History.class));
                break;
</code></pre>
