views:

21

answers:

0

I am writing the code for the tab activity but there is a problem that when i navigate from 1 tab to another tab then it does not finish the activity of the previous tab. suppose there are 3 tab A , B ,C by default it will goes to A when i am pressing B then it go there and when i press 3 it goes there. but when i press back button then it goes to the previous tab i don't want to open the previous tab please give me the solution for this.

Here is my Code intent = new Intent().setClass(this, ShowNotification.class);

        // Initialize a TabSpec for each tab and add it to the TabHost
        spec = tabHost.newTabSpec("A").setIndicator("A",
                      res.getDrawable(R.drawable.notification))
                  .setContent(intent);
        tabHost.addTab(spec);

intent = new Intent().setClass(this, Classes.class); spec = tabHost.newTabSpec("B").setIndicator("B", res.getDrawable(R.drawable.myclasses)) .setContent(intent); tabHost.addTab(spec);

intent = new Intent().setClass(this, ShowSettings.class); spec = tabHost.newTabSpec("C").setIndicator("C", res.getDrawable(R.drawable.setting)) .setContent(intent); tabHost.addTab(spec); tabHost.setCurrentTab(Integer.parseInt(getIndex));

Please give me any link by which we can use views instead of activities