List of usage examples for android.app FragmentManager removeOnBackStackChangedListener
public abstract void removeOnBackStackChangedListener(OnBackStackChangedListener listener);
From source file:com.android.tv.ui.TvOverlayManager.java
private void runAfterSideFragmentsAreClosed(final Runnable runnable) { final FragmentManager manager = mMainActivity.getFragmentManager(); if (mSideFragmentManager.isSidePanelVisible()) { manager.addOnBackStackChangedListener(new OnBackStackChangedListener() { @Override/*from ww w.j a v a 2 s .c om*/ public void onBackStackChanged() { if (manager.getBackStackEntryCount() == 0) { manager.removeOnBackStackChangedListener(this); runnable.run(); } } }); } else { runnable.run(); } }