I have the following code but cannot seem to figure out why I am getting the above error message. I obviously know what it means but I've checked the brackets and they seem correct to me. I'm running ADT 21.1.0. So far I've tried restarting Eclipse; restarting my PC; and re-building the project.
package cct.mad.lab;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
public class WalkList extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// storing string resources into Array
String[] players = getResources().getStringArray(R.array.players);
// Binding resources Array to ListAdapter
this.setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, R.id.label, players));
}
protected void onListItemClick (ListView 1, View v, int position, long id) {
String item = (String) getListAdapter().getItem(position);
Toast.makeText(this, item + " selected", Toast.LENGTH_LONG).show();
}
}
1is no valid variable name.