Code example for FragmentActivity

Methods: onSaveInstanceState

0
        } 
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putInt("level", mStackLevel);
    } 
 
 
    void showDialog() { 
        mStackLevel++;
 
        // DialogFragment.show() will take care of adding the fragment 
        // in a transaction.  We also want to remove any currently showing 
        // dialog, so make our own transaction and take care of that here. 
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        Fragment prev = getSupportFragmentManager().findFragmentByTag("dialog");
        if (prev != null) {
            ft.remove(prev);
        }