shihyingru
8/7/2018 - 1:29 AM

Fragment

銷毀堆疊

// 20171207 銷毀堆疊 ----------------------------------------------------------------------
        int backStackCount = myGlobalValue.getFragmentManager().getBackStackEntryCount();
        if (myGlobalValue.getBeforePage() == MyTest.Page.BookInformation && backStackCount > 0) {
            // In your FragmentActivity use getSupprotFragmentManager() to get the FragmentManager.
            // Clear all back stack.
            for (int i = 0; i < backStackCount; i++) {
                // Get the back stack fragment id.
                int backStackId = myGlobalValue.getFragmentManager().getBackStackEntryAt(i).getId();
                myGlobalValue.getFragmentManager().popBackStack(backStackId, FragmentManager.POP_BACK_STACK_INCLUSIVE);
            } / end of for /
        }