I’m reading Android Application Developement for Dummies and i’m at Chapter 9 where I’m writing a Task reminder app. I have a onListItemClick method, but Eclipse keeps giving errors….
package com.dummies.android.taskreminder;
import android.app.Activity;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.*;
public class ReminderListActivity extends ListActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.reminder_list);
String[] items = new String[] { "Foo", "Bar", "Fizz", "Bin" };
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this, R.layout.reminder_row, R.id.text1, items);
setListAdapter(adapter);
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
}
}
}
my error: my error
Eclipse says:
“View cannot be resolved to a type”
“Syntax erroe on token ….. expected” (5x)
“void is an invalid type for the variable onListItemClick”
What did I do wrong?
try this