List of usage examples for android.support.v4.app BackStackRecord getName
public String getName()
From source file:com.tencent.tws.assistant.support.v4.app.FragmentManager.java
boolean popBackStackState(Handler handler, String name, int id, int flags) { if (mBackStack == null) { return false; }// w ww .j a v a 2 s .c o m if (name == null && id < 0 && (flags & POP_BACK_STACK_INCLUSIVE) == 0) { int last = mBackStack.size() - 1; if (last < 0) { return false; } final BackStackRecord bss = mBackStack.remove(last); bss.popFromBackStack(true); reportBackStackChanged(); } else { int index = -1; if (name != null || id >= 0) { // If a name or ID is specified, look for that place in // the stack. index = mBackStack.size() - 1; while (index >= 0) { BackStackRecord bss = mBackStack.get(index); if (name != null && name.equals(bss.getName())) { break; } if (id >= 0 && id == bss.mIndex) { break; } index--; } if (index < 0) { return false; } if ((flags & POP_BACK_STACK_INCLUSIVE) != 0) { index--; // Consume all following entries that match. while (index >= 0) { BackStackRecord bss = mBackStack.get(index); if ((name != null && name.equals(bss.getName())) || (id >= 0 && id == bss.mIndex)) { index--; continue; } break; } } } if (index == mBackStack.size() - 1) { return false; } final ArrayList<BackStackRecord> states = new ArrayList<BackStackRecord>(); for (int i = mBackStack.size() - 1; i > index; i--) { states.add(mBackStack.remove(i)); } final int LAST = states.size() - 1; for (int i = 0; i <= LAST; i++) { if (DEBUG) Log.v(TAG, "Popping back stack state: " + states.get(i)); states.get(i).popFromBackStack(i == LAST); } reportBackStackChanged(); } return true; }