是否有可能推出从preference一个DialogFragment在preferenceActivity? [英] Is it possible to launch a DialogFragment from a Preference in a PreferenceActivity?

查看:193
本文介绍了是否有可能推出从preference一个DialogFragment在preferenceActivity?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的应用程序使用V4兼容包和片段。我已经做得很好了,到目前为止,但我需要从preference点击启动DialogFragment在 preferenceActivity 。由于没有一个preferenceFragment在兼容性库,我坚持使用 preferenceActivity 。是否有可能得到一个参考片段经理,并调用 DialogFragment 或者我只需要继续使用旧的对话框,如果我需要一个对话框,从preference ?

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?

推荐答案

不无铁圈跳。

您可以用启动DialogFragment的唯一目的做出了一个非常简单的活动。如果你这样做,你将需要完成()的活动DialogFragment对话框被解雇的时候。

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.

这篇关于是否有可能推出从preference一个DialogFragment在preferenceActivity?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆