构造函数ArrayAdapter <list <string>&gt;(Context,int,List <string>)未定义</string> </list <string>

时间:2014-02-09 10:00:21

标签: android android-arrayadapter

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);
}

错误显示“构造函数ArrayAdapter&gt;(Context,int,List)未定义”为什么?,我该怎么办?

1 个答案:

答案 0 :(得分:1)

adapter2应该是ArrayAdapter<String>,而不是ArrayAdapter<List<String>>

adapter2 = new ArrayAdapter<String>(getActivity().getBaseContext(),
           android.R.layout.simple_list_item_1, list);