ssuperz28
ssuperz28

Reputation: 1844

Is it possible to launch a DialogFragment from a Preference in a PreferenceActivity?

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?

Upvotes: 12

Views: 2551

Answers (1)

roflharrison
roflharrison

Reputation: 2320

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.

Upvotes: 7

Related Questions