I have a tab activity that every of my applications tabs are opening the same activity lets say SecondActivity.So the code is as shown below.
TabSpec firstTab = tabHost.newTabSpec("tid1");
firstTab.setIndicator("First Tab Name").setContent(new Intent(this,SecondActivity..class));
tabHost.addTab(firstTab);
TabSpec secondTab = tabHost.newTabSpec("tid1");
firstTab.setIndicator("Second Tab Name").setContent(new Intent(this,SecondActivity.class));
tabHost.addTab(secondTab);
now I want to pass some data from my tab activity every time the SecondActivity activity is called. So I tried it this way but it didnt seem to work:
TabSpec firstTab = tabHost.newTabSpec("tid1");
Intent intent = new Intent(this, SecondActivity.class);
Bundle b1 = new Bundle();
b1.putString("name","Something");
firstTab.setIndicator("First Tab Name").setContent(intent);
tabHost.addTab(firstTab);
TabSpec secondTab = tabHost.newTabSpec("tid1");
Intent intent = new Intent(this, SecondActivity.class);
Bundle b2 = new Bundle();
b2.putString("name","Something2");
secondTab.setIndicator("First Tab Name").setContent(intent);
tabHost.addTab(SecondTab);
Does anyone have any idea if it should work in this way or if is it possible to do it in any other way?? In other worlds I want the second activity to know which of the tabs is pressed