Every tutorial I've tried to follow thus far has tried to get me to use a LayoutInflator inside the getView() in my CustomAdapter.
The LayoutInflator does not turn up for me and I only get the options of LayoutInflatorCompat or LayoutFactory.
Can anyone help me take the data out of the user object I have created and set it to the 2 appropriate text fields in my rowlayout.xml?
I'm assuming this still needs to be done inside my getView() method inside my UserAdapter.
User only has 2 Strings, name and description. My rowlayout has tv_name, tv_description.
public class UserAdapter extends BaseAdapter {
ArrayList<user> list;
Context context;
public UserAdapter(Context c,ArrayList<user> list)
{
context = c;
this.list = list;
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int position) {
return list.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return null;
}
}