i have this class which extends BaseAdapter
that i use to insert an icon
and a textView
for each row of a listView
that is inside a drawer
public class NavRightDrawerListAdapter extends BaseAdapter {
private Context context;
LinkedList<String> userNameUsedForListView;
Map<String, Bitmap> urlUserImage;
public NavRightDrawerListAdapter(Context context, LinkedList<String> userNameUsedForListView, Map<String, Bitmap> returnBitMapFromURL) {
this.context = context;
this.userNameUsedForListView = userNameUsedForListView;
this.urlUserImage = returnBitMapFromURL;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
int count = 0;
if (convertView == null) {
LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
convertView = mInflater.inflate(R.layout.drawer_list_of_action, null);
}
ImageView imgIcon = (ImageView) convertView.findViewById(R.id.icon);
TextView txtTitle = (TextView) convertView.findViewById(R.id.title);
imgIcon.setImageBitmap(urlUserImage.get(userNameUsedForListView.get(count)));
txtTitle.setText(userNameUsedForListView.get(count));
count++;
return convertView;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return 0;
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return null;
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return 0;
}
}
and in my activity i do this:
[...]
rightDrawerLinearLayout = (LinearLayout) findViewById(R.id.right_drawer_ll);
rightDrawerListForFollow = (ListView) findViewById(R.id.right_drawer);
NavRightDrawerListAdapter adapter = new NavRightDrawerListAdapter(getApplicationContext(), userNameUsedForListView,returnBitMapFromURL);
rightDrawerListForFollow.setAdapter(adapter);
[...]
i notice that the getView is not being called, someone can explain me why?
thanks a lot.