I'm trying to fetch a image path from a mysql database using php and displaying the image in a gridview.

**My problem is that am getting a NPE (NullPointerException) in the adapter when setting the images.** 

Here my `GridViewAdapter`:

```
public class GridViewAdapter extends BaseAdapter {

    private Context context;
    public ArrayList<HashMap<String,String>> mThumbIds = new ArrayList<HashMap<String, String>>();
    AQuery aQuery;
    private LayoutInflater mInflater;

    public GridViewAdapter(Context context,ArrayList<HashMap<String,String>> data) {
        this.context= context;
        this.mThumbIds = data;
        this.aQuery = new AQuery(context);
    }

    @Override
    public int getCount() {
        return mThumbIds.size();
    }

    @Override
    public Object getItem(int position) {
        return  0;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        final ViewHolder holder;
        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.photo_gallery_list_item, null);
            holder = new ViewHolder();
            holder.imageView = (ImageView) convertView.findViewById(R.id.imageView);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        aQuery.id(holder.imageView).image(mThumbIds.get(position).get("flag"), true, true);
        return convertView;
    }

    class ViewHolder {

        ImageView imageView;

    }
}

```

The Line that fire the NPE is the following:

```
 convertView = mInflater.inflate(R.layout.photo_gallery_list_item, null);

```

Can anyone suggest where am wrong?