Unless parent Fragment is retained, setting parent-Fragment as targetFragment will cause an IllegalStateException when changing orientation (or restoring from savedInstance), because the SimpleDialogFragment will be recreated before the parent has been restored.
java.lang.IllegalStateException: Fragement no longer exists for key android:target_state: index 1
Proposed solution: fallback first to parent-Fragment if no targetFragment is set, then fallback to Activity if SimpleDialogFragment has no parent-Fragment.
Unless parent Fragment is retained, setting parent-Fragment as targetFragment will cause an
IllegalStateException
when changing orientation (or restoring from savedInstance), because the SimpleDialogFragment will be recreated before the parent has been restored.This:
Will cause:
Proposed solution: fallback first to parent-Fragment if no targetFragment is set, then fallback to Activity if SimpleDialogFragment has no parent-Fragment.