Question

I am converting my app to use the v4 compatibility package and fragments. I have done well so far, but I need to launch a DialogFragment from a preference click in a PreferenceActivity. Since there isn't a PreferenceFragment in the compatibility library, I'm stuck with using PreferenceActivity. Is it possible to get a reference to the fragment manager and call the DialogFragment or do I just have to continue using the old dialog if I need a dialog from a preference?

Was it helpful?

Solution

Not without jumping through hoops.

You could make a very simple activity with the sole purpose of launching the DialogFragment. If you do this you will need to finish() that activity when the DialogFragment dialog has been dismissed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top