Code example for DialogFragment

Methods: onSaveInstanceState

0
    /* (non-Javadoc) 
     * @see android.app.DialogFragment#onSaveInstanceState(android.os.Bundle) 
     */ 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
 
        outState.putInt("layoutId", layoutId);
        outState.putInt("titleId", titleId);
        outState.putInt("positiveStringId", positiveStringId);
        outState.putInt("neutralStringId", neutralStringId);
        outState.putInt("negativeStringId", negativeStringId);
    } 
 
    @Override 
    public Dialog onCreateDialog(Bundle savedInstanceState) {
 
        if (layoutId == 0 && titleId == 0 && savedInstanceState != null) { 
            layoutId = savedInstanceState.getInt("layoutId"); 
            titleId = savedInstanceState.getInt("titleId"); 
            positiveStringId = savedInstanceState.getInt("positiveStringId");