0
protected void onPostExecute(List<String> result){
   // here i will make adapter
   List<String> list = result;
   adapter2 = new ArrayAdapter<List<String>> (getActivity().getBaseContext(),
            android.R.layout.simple_list_item_1, list);
   listV2.setAdapter(adapter2);
}

Error shows "The constructor ArrayAdapter>(Context, int, List) is undefined" Why?, What should i do?

1 Answer 1

1

adapter2 should be an ArrayAdapter<String>, not an ArrayAdapter<List<String>>:

adapter2 = new ArrayAdapter<String>(getActivity().getBaseContext(),
           android.R.layout.simple_list_item_1, list);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.