/** * 显示一个Fragment * * @param fragment */ public void showFragment(Fragment fragment) { if (fragment.isHidden()) { FragmentTransaction fragmentTransaction = getFragmentTransaction(); fragmentTransaction.show(fragment); fragmentTransaction.commit(); } }
/** * 隐藏一个Fragment * * @param fragment */ public void hideFragment(Fragment fragment) { if (!fragment.isHidden()) { FragmentTransaction fragmentTransaction = getFragmentTransaction(); fragmentTransaction.hide(fragment); fragmentTransaction.commit(); } }
public boolean isHidden() { return zzadh.isHidden(); }