java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'- error

<>

This question already has an answer here:

Answers


Try this..

Your using ListActivity then id for your ListView in your layout should be @android:id/list

<?xml version="1.0" encoding="UTF-8"?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

</ListView>

and also Remove ListView listView = (ListView) findViewById(R.id.tourList); then

 // Get listview
ListView lv = getListView();
tourNumberListAdapter = new TourNumberListAdapter(this, cursorTourNumberInfo);
setListAdapter(tourNumberListAdapter);

lv.setOnItemClickListener(new OnItemClickListener() {

Change your listview's id to @android:id/list

So use this

<?xml version="1.0" encoding="UTF-8"?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</ListView>

instead of

<?xml version="1.0" encoding="UTF-8"?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tourList"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

</ListView>

Need Your Help

jquery POST response successful BUT data empty

javascript jquery html post response

im using jquery to send a post to a session endpoint of my api to get a login token. the request returns success, however the data is empty. if i do the same request in cURL it returns json.

URL regex search and replace on MySQL (in WordPress)

mysql regex wordpress phpmyadmin replace

I have a WordPress blog with numerous URL's I wish to replace from this: