Reload tab in android
I have tabhost in my application(2 tabs),when i select tab2 the content has been dislayed has a list view ,again i have list click event here to move further another list view,here the 2tab already in selected mode and it's focus not been changed,when i click the 2tab again i need it to reload its content has loaded initially with first list view content.how can i get it.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TabHost tabHost = getTabHost();
tabHost.addT开发者_StackOverflowab(tabHost.newTabSpec("tab1")
.setIndicator("OPT")
.setContent(new Intent(this, TabGroup1Activity.class)));
tabHost.addTab(tabHost.newTabSpec("tab2")
.setIndicator("EDIT")
.setContent(new Intent(this, TabGroup2Activity.class)));
tabHost.setCurrentTab(1);
}
You could also re-issue another intent to refresh the tab
try public void onResume() {} method
精彩评论