Java tutorial
/** * Robert Williamson 2014-2016. * This program is distributed under the terms of the GNU General Public License. */ package com.robwilliamson.healthyesther.fragment.dialog; import android.app.Dialog; import android.os.Bundle; import android.support.v4.app.DialogFragment; public class FixedDialogFragment extends DialogFragment { public FixedDialogFragment() { } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); } @Override public void onDestroyView() { Dialog dialog = getDialog(); if (dialog != null && getRetainInstance()) { dialog.setOnDismissListener(null); } super.onDestroyView(); } }