Hi,

So I'm trying to put together a custom adapter.

Alright so I made a small mistake the first time I posted.

my issue is

he row.findViewById(<layout id>) call. (row is type view)

The View api says find view by id"Look for a child view with the given tag. If this view has the given tag, return this view."

so it should return type view. For me it is returning null and I know for sure the layout id is running a proper number.

is there something I should do to make the row.xml a CHILD of something? Is that why it might be returning null?

Code:
public class ContactAdapter extends ArrayAdapter<ResultSet>{
	
	Context _context;
	int _layoutResourceId;
	ArrayList<ResultSet> _results;
	
	public ContactAdapter(Context context, int layoutResourceId,ArrayList<ResultSet> results) {
		super(context, layoutResourceId,results);
		_context = context;
		_layoutResourceId = layoutResourceId;
		_results = results;
	}
	@Override
	public View getView(int position, View convertView,ViewGroup parent){
		View row = convertView; //row becomes null because convertView is null
        ResultHolder holder = null;
        
        if(row == null)
        {
            LayoutInflater inflater = ((Activity) _context).getLayoutInflater();
            row = inflater.inflate(_layoutResourceId, parent, false);
            
            holder = new ResultHolder();
            holder.imgIcon = (ImageView)row.findViewById(R.id.imgIcon);
            holder.topText = (TextView) row.findViewById(R.id.top_text);
            holder.bottomText = (TextView)row.findViewById(R.id.bottom_text);
            
            row.setTag(holder);
        }
        else
        {
            holder = (ResultHolder)row.getTag();
        }
        
        ResultSet result = _results.get(position);
        holder.topText.setText(result.getName());
        holder.bottomText.setText(result.getEmail());
        //holder.imgIcon.setImageResource(weather.icon);
        
        return row;
    }