It is a bit odd - or maybe just a bug in this Android functionality. I have added block try catch
to catch throwing exception in this way:
MyDialogFragment fragment = new MyDialogFragment(listener, "Hello " + name);
try {
fragment.show(activity.getFragmentManager(), "myDialog");
} catch (Exception e) {
e.printStackTrace();
}
And of course exception is still throwing (and catching at this moment) and what is interesting my dialog fragment is recreating in correct way and user can interact with it.