The convertView
usage is wrong here.
You should use it differently: - If is null, inflate the view - If not, do nothing (and will use it) Then you close that bracket and set your data.
Try this:
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (convertView == null) {
convertView = inflater.inflate(R.layout.item_grid_shop, null);
}
TextView textView = (TextView) convertView.findViewById(R.id.grid_item_label);
Log.d("Shop", "pozycja: " + position);
textView.setText(gridValues[position]);
ImageView imageView = (ImageView) convertView.findViewById(R.id.grid_item_image);
imageView.setImageResource(R.drawable.ic_launcher);
return convertView;
}