Here is the problem. I have a list view, and it looks fine in the building, but it broke the error. Content has view with id attribute \'android.r.id.list\' that is not a Li
I was using:
android:id="@+id/listView"
Then, I have replaced to it:
android:id="@android:id/list"
I haven't added the listview into the XML
Add a ListView
with an android:id
of @android:id/list
to your layout, where you want the list to appear.
Or, delete your onCreateView()
implementation, so you get the inherited ListView
that you get from ListFragment
.
Or, change your fragment to inherit from Fragment
, not ListFragment
and manage a ListView
by yourself.
Or, change your fragment to inherit from Fragment
and do not attempt to show a list in it.
You can inflate your View on onCreateView() method in which layout your ListView and id of that ListView must be
@android:id/list
and after that on onCreateView() method
ListView lv = (ListView)contactLayout.findViewById(android.R.id.list);