解决java.lang.IllegalStateException: Content view not yet created(ListFragment)

java.lang.IllegalStateException: Content view not yet created(ListFragment)  

解决java.lang.IllegalStateException: Content view not yet created(ListFragment)_第1张图片



把代码中的ListView lv = getListView()
统一改为ListView lv = (ListView)v.findViewById(android.R.id.list);
当然在xml要加上
   <ListView
        android:id="@id/android:list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />

你可能感兴趣的:(解决java.lang.IllegalStateException: Content view not yet created(ListFragment))