Пример #1
0
 @Override
 /*.*/ public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) {
   // mFragment.getView().setVisibility(View.GONE);
   controls.pOnActionBarTabUnSelected(pascalObj, mFragment.getView(), mFragment.getText());
   if (mFragment != null) {
     ft.hide(mFragment);
   }
 }
Пример #2
0
 // http://www.grokkingandroid.com/adding-action-items-from-within-fragments/
 // http://www.j2eebrain.com/java-J2ee-android-menus-and-action-bar.html
 // http://www.thesparkmen.com/2013/2/15/dynamic-action-bar-buttons.aspx
 // https://github.com/codepath/android_guides/wiki/Creating-and-Using-Fragments  otimo!
 // http://www.lucazanini.eu/2012/android/tab-layout-in-android-with-actionbar-and-fragment/?lang=en
 @Override
 /*.*/ public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {
   mFragment.getView().setVisibility(View.VISIBLE);
   controls.pOnActionBarTabSelected(pascalObj, mFragment.getView(), mFragment.getText());
   if (mFragment.isAdded()) {
     ft.show(mFragment);
   } else {
     ft.add(0, mFragment, mFragment.getText()); // 0=null container!
   }
 }