Reputation: 865
I have following code snippet ! I get error on the super call to ArrayAdapter constructor. I am not able to figure out why it is not taking list of maps in constructor call to super !
Error : can not resolve method
super(android.App.activity, int, java.util.List<java.util.Map<java.lang.String, java.lang.String>>)
public class ListAdapter extends ArrayAdapter<List<Map<String,String>>> {
private Context m_Context;
private String[] m_ItemName;
private Integer[] m_ImgId;
public ListAdapter(Activity context, List<Map<String,String>> myList) {
super(context, R.layout.org_list_single_item, myList);
this.m_Context=context;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(m_Context).inflate(R.layout.org_list_single_item, parent, false);
TextView txtTitle = (TextView) convertView.findViewById(R.id.img_dtl);
ImageView imageView = (ImageView) convertView.findViewById(R.id.img);
txtTitle.setText(m_ItemName[position]);
imageView.setImageResource(m_ImgId[position]);
}
return convertView;
}
}
Thanks
Upvotes: 2
Views: 1837
Reputation: 116
For ArrayAdapter<T>
, the third parameter should be of type List<T>
objects.
So in your case : List<List<Map<String,String>>>
Upvotes: 6