I have a class within an Activity called Pdj . . .
private class ButtonListener implements View.OnClickListener {
public void onClick(View v) {
ListView myListView = (ListView)findViewById(R.id.pdjListView);
EditText screen2EditText = (EditText)findViewById(R.id.pdjEditText);
ArrayList<String> todoArrayList = new ArrayList<String>();
// array adapter to bind the array to the list view
ArrayAdapter<String> aa = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1,
todoArrayList);
. . .
The last line generates the build error "The constructor ArrayAdapter(Pdj.ButtonListener, int, ArrayList) is undefined"
Someone else on StackOverflow reported this problem an was told to try . . .
ArrayAdapter<String> aa = new ArrayAdapter<String>(this.getContext(),
android.R.layout.simple_list_item_1,
todoArrayList);
... but that just produces "The method getContext() is undefined for the type Pdj.ButtonListener"
Thanks in advance!!