Code example for DialogFragment

Methods: getDialog, getRetainInstance, onDestroyView

0
    } 
 
    @Override 
    public void onDestroyView() // necessary for restoring the dialog 
    { 
        if (getDialog() != null && getRetainInstance())
            getDialog().setOnDismissListener(null);
 
        super.onDestroyView(); 
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState)
    { 
        // ... 
 
        super.onSaveInstanceState(outState);
        WorkaroundSavedState.savedInstanceState = outState;
        Log.d("TAG", "saved instance state onsaveins: "
                + WorkaroundSavedState.savedInstanceState);