FragmentManager getBackStackEntryAt - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for FragmentManager getBackStackEntryAt method.

This code example shows how to use the following methods:beginTransaction, executePendingTransactions, findFragmentByTag, getBackStackEntryAt, getBackStackEntryCount
  	} 
  } 
   
  private void removePreviousFragment() { 
    FragmentManager fm = getSupportFragmentManager();
    int count = fm.getBackStackEntryCount();
    if (count > 0) {
    	FragmentTransaction ft = fm.beginTransaction();
      ft.setCustomAnimations(android.R.anim.slide_in_left, android.R.anim.slide_out_right, android.R.anim.slide_out_right, android.R.anim.slide_in_left);
    	//ft.hide(mCurrentFragment); 
      fm.popBackStack();
      fm.executePendingTransactions();
      if (count > 1) {
        String name = fm.getBackStackEntryAt(count-2).getName();
        mCurrentFragment = fm.findFragmentByTag(name);
      } else { 
        mCurrentFragment = null;
      } 
    } 
  } 
6
CodeRank

Related FragmentManager getBackStackEntryAt Questions & Answers:

getBackStackEntryAt Method Overview
Return the BackStackEntry at index index in the back stack; entries start index 0 being the bottom of the stack.
See Code Examples for other Android FragmentManager Methods: