Reputation: 753
Although i saw many issues on this an tried to implement all of them i decided to ask this question again since none of the suggested methods worked for me.
Problem: Im trying to show a custom dialog based on a DialogFragment inside an ActivityFragment. the Activity is being recreated on orientation change since it has a different layout. Every time that happens the DialogFragment vanishes. (i am using the latest support package)
Things i have tired:
and some other documented solutions. nothing seems to work, i tired with may variations of these solutions, the reason my custom dialog holds many ui elements in various states and i really have to get this to work.
If anyone could please provide some code to a solution it would be much appreciated.
Thanks, Totem
Upvotes: 4
Views: 1695
Reputation: 753
The problem was that the FragmentManager is also retained through the onSaveInstanceState() of the parent which i neglected to call when overriding it in the ActivityFragment for my own purposes.
Thanks, Totem
Upvotes: 3