In Android app Development for Dummies and I am getting an error after the last bit of code.
The method
setListAdapter(ArrayAdapter<String>)is undefined for the typeReminderListActivity
The code is as follows:
package com.dummies.android.taskreminder;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
public class ReminderListActivity extends Activity {
/** 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);
}
}
It looks to me like
Activitydoesn’t havesetListAdapter()but its subclassListActivitydoes. Maybe you wantinstead? This should work fine: