【问题标题】:Dialog from WebFragment来自网络片段的对话
【发布时间】:2013-07-02 12:14:48
【问题描述】:

我已经看到关于片段中对话框的问答,解决方案是使用 DialogFragment,例如参见here。但我已经不得不使用 WebFragment - 所以我不可能从中显示一个对话框吗?

【问题讨论】:

    标签: android


    【解决方案1】:

    不,这并非不可能。使用 AlertDialog.Builder 在运行时显示对话框。它非常易于使用。检查this答案

    【讨论】:

    • 传递片段的getActivity()方法,例如:new AlertDialog.Builder(this.getActivity())
    • 完美。谢谢。只要允许,我就会标记为正确。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-08
    • 2019-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多