am 41f665a5: am c84362a7: am a29e2cca: docs: Fixing Issue with code for Adding Tabs topic bug 4293013
* commit '41f665a5f9d4e73ba8dabceb721c9c8873591bac': docs: Fixing Issue with code for Adding Tabs topic bug 4293013
This commit is contained in:
@@ -429,21 +429,18 @@ private class MyTabListener implements ActionBar.TabListener {
|
|||||||
private TabContentFragment mFragment;
|
private TabContentFragment mFragment;
|
||||||
|
|
||||||
// Called to create an instance of the listener when adding a new tab
|
// Called to create an instance of the listener when adding a new tab
|
||||||
public TabListener(TabContentFragment fragment) {
|
public MyTabListener(TabContentFragment fragment) {
|
||||||
mFragment = fragment;
|
mFragment = fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabSelected(Tab tab, FragmentTransaction ft) {
|
public void onTabSelected(Tab tab, FragmentTransaction ft) {
|
||||||
ft.add(R.id.fragment_content, mFragment, null);
|
ft.add(R.id.fragment_content, mFragment, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabUnselected(Tab tab, FragmentTransaction ft) {
|
public void onTabUnselected(Tab tab, FragmentTransaction ft) {
|
||||||
ft.remove(mFragment);
|
ft.remove(mFragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTabReselected(Tab tab, FragmentTransaction ft) {
|
public void onTabReselected(Tab tab, FragmentTransaction ft) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user