相关疑难解决方法(0)

ListFragment作为DialogFragment

有可能显示ListFragmentDialog?或者没有办法,我应该在自己内部实现自己的ListView,空洞的TextView和不确定的?ProgressBarDialogFragment

android

1
推荐指数
1
解决办法
2915
查看次数

在DialogFragment中填充类片段时出错

我正在尝试使用其中的listview创建一个dialogfragment,并使用此问题中接受的答案来执行此操作

如何在DialogFragment中显示现有的ListFragment

但是Error inflating class fragment当我尝试打开片段对话框并且应用程序崩溃时,我得到了一个

下面是dialog_fragment_with_list_fragment布局

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

 <fragment
         android:id="@+id/flContent"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:padding = "10dp"
         class="com.OptimusApps.stayhealthy.AndroidXMLParsingActivity" />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

并且它不是导致它失败的androidxmlparsingactivity片段,我用其他片段尝试过它们也没有用

下面是我的对话框片段类

public class BodyDialogue extends DialogFragment {
int mNum;

/**
 * Create a new instance of MyDialogFragment, providing "num"
 * as an argument.
 */
static BodyDialogue newInstance(int num) {
    BodyDialogue f = new BodyDialogue();

    // Supply num input as an argument.
    Bundle args = new Bundle();
    args.putInt("num", num);
    f.setArguments(args); …
Run Code Online (Sandbox Code Playgroud)

java android android-fragments android-dialogfragment android-fragmentactivity

0
推荐指数
1
解决办法
3686
查看次数