OnCancelListener is not called in DialogFragment
I have a simple AlertDialog that displays a list of some items and upon clicking one of them, the clicked item is passed back to the enclosing Activity . I also want to perform some default handling when the user cancels the dialog (using the back button ) - more specifically, I want to pass an empty string to the activity in such case. However, if I put the dialog in a DialogFragment (from the compatibility package ), the OnCancelListener is not called when I close the dialog with the back button . What am I doing wrong? public class SelectItemDialog extends DialogFragment { public interface