1

I have 3 activity I want to destroy the earlier activity when i move to new activity in TabActivity

TabHosttabHost = getTabHost();


    Intent in1 = new Intent(this, ActivityA.class);
    // adding each tab details to tabhost
    tabHost.addTab(tabHost
            .newTabSpec("1")
            .setIndicator("TAB3",
                    getResources().getDrawable(R.drawable.tab1))
            .setContent(it5));
                    Intent it5 = new Intent(this, ActivityB.class);
    // adding each tab details to tabhost
    Intent in2 = new Intent(this, ActivityB.class);
    tabHost.addTab(tabHost
            .newTabSpec("2")
            .setIndicator("TAB3",
                    getResources().getDrawable(R.drawable.tab2))
            .setContent(it5));
                    Intent it5 = new Intent(this, ActivityC.class);
    // adding each tab details to tabhost
    Intent in3 = new Intent(this, ActivityC.class);
    tabHost.addTab(tabHost
            .newTabSpec("3")
            .setIndicator("TAB3",
                    getResources().getDrawable(R.drawable.tab3))
            .setContent(it5)); 
Shakeeb Ayaz
  • 6,200
  • 6
  • 45
  • 64

1 Answers1

3

Don't use Tab Activity then(TabActivity is deprecated now).

Simply create three activities and place three buttons at the bottom of each activity.

and while switching from one activity to another just call finish() after startActivity().

I am again saying not to use TabActivity because i have used it in one of my project an that was a headache for me.

dd619
  • 5,910
  • 8
  • 35
  • 60