Code example for FragmentActivity

Methods: onSaveInstanceState

0
        } 
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putInt("level", mStackLevel);
    } 
 
 
    void addFragmentToStack() { 
        mStackLevel++;
 
        // Instantiate a new fragment. 
        Fragment newFragment = CountingFragment.newInstance(mStackLevel);
 
        // Add the fragment to the activity, pushing this transaction 
        // on to the back stack. 
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.setCustomAnimations(R.anim.fragment_slide_left_enter,
                R.anim.fragment_slide_left_exit,