Problem with AsyncTask. It does not like my ArrayAdapter:
listAdapter = new ArrayAdapter<String>(this, R.layout.simplerow, result);
Fault message: "Cannot resolve constructor"...to long to write.
The code snippet:
private class UpdateListviewWithStringAsync extends AsyncTask<String, Void, ArrayList> {
@Override
protected ArrayList doInBackground(String... infos) {
oneLogger = new ArrayList<String>();
for (String info : infos) {
Log.d("Haze", info);
oneLogger = new ArrayList<String>();
oneLogger.add(info);
}
return oneLogger;
}
@Override
protected void onPostExecute(ArrayList... result) {
listAdapter = new ArrayAdapter<String>(this, R.layout.simplerow, result);
listView.setAdapter(listAdapter);
}
}
I have had this ArrayAdapter declaration before in other parts of the code but not in this AsyncTask code. I'm guessing that I'm trying to do this:
ArrayAdapter(Context context, int resource, List objects)
Please help me understand why this is wrong:)