I have 2 activities, The first activity consist of two buttons that goes to the second activity.
The second activity consists of 2 tab host.
I want to enable the 2nd tabhost from the button of the first activity. how can i do that, please help me and thank you... ^_^
The First Activity Code:
public void OnClickRanoNews(View v)
{
if (v.getId() == R.id.btnRanoNews)
{
Intent i = new Intent(this, RanoNews.class);
startActivity(i);
}
}
public void OnClickRanoNews2(View v)
{
if(v.getId()== R.id.btnRanoNews2)
{
Intent i = new Intent(this, RanoNews.class);
startActivity(i);
//I want to disable the second tabhost in this button
}
}
The Second Activity Code:
tabHost = (TabHost)findViewById(R.id.tabHost);
tabHost.setup();
TabHost.TabSpec
tabSpec = tabHost.newTabSpec("rano news");
tabSpec.setContent(R.id.tabRanoNews);
tabSpec.setIndicator("Rano News");
tabHost.addTab(tabSpec);
tabSpec = tabHost.newTabSpec("adding form");
tabSpec.setContent(R.id.tabAddingForm);
tabSpec.setIndicator("Adding Form");
tabHost.addTab(tabSpec);
tabHost.getTabWidget().getChildTabViewAt(1).setEnabled(true);
public void OnClickRanoNews2(View v)
{
if(v.getId()== R.id.btnRanoNews2)
{
Intent i = new Intent(this, RanoNews.class);
i.putExtra("msg", "0");
startActivity(i);
}
}
on the second Activity
if(getIntent() != null){
if(getIntent().getStringExtra("msg").equals("0")){
tabHost.getTabWidget().getChildTabViewAt(1).setEnabled(true);
}
}