title: GridView showing duplicate Item
body: <p>I am really surprised, what is happening with the code, the gridView items are showing duplicate at 11th position every time and 12th position also sometimes.</p>
  
  <p><a href="https://i.stack.imgur.com/iRzFx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iRzFx.png" alt="enter image description here"></a></p>
  
  <p>You can see the "Desktop" grid has been populated twice.</p>
  
  <p><strong>Grid Icon &amp; Name from a constant file</strong></p>
  
  <pre><code>public static final String[] values = {
              DESKTOP,
              LAPTOP,
              SERVER,
              PRINTER,
              NETWORK_SUPPORT,
              AIR_CONTITION,
              CCTV_CAMERA,
              ALL_IN_ONE_PC,
              HOME_CLEANING,
              APPLICANCE_REPAIR,
              ELECTRICITY,
              PLUMBING
      };
  
      public static final int[] images = {
              R.drawable.desktop_pc_icon,
              R.drawable.laptop_pc_icon,
              R.drawable.server_icon,
              R.drawable.printer_icon,
              R.drawable.network_support_icon,
              R.drawable.aircondition_icon,
              R.drawable.cctv_camera_icon,
              R.drawable.all_in_one_pc_icon,
              R.drawable.home_cleaning_icon,
              R.drawable.appliance_repair_icon,
              R.drawable.electrical_icon,
              R.drawable.plumbing_icon
      };
  </code></pre>
  
  <p><strong>Grid Adopter Setting(In onCreate method)</strong></p>
  
  <pre><code> final GridView mainGrid = (GridView) findViewById(R.id.main_grid);
          mainGrid.setAdapter(new GridAdapter(MainActivity.this, AppConstants.productsId, AppConstants.values, AppConstants.images));
  </code></pre>
  
  <p><strong>Grid Adapter</strong></p>
  
  <pre><code>public class GridAdapter extends BaseAdapter {
  
      private final String[] productsId;
      private final String[] values;
      private final int[] images;
      private Context context;
      private LayoutInflater layoutInflater;
  
      public GridAdapter(final Context context, final String [] productsId, final String[] values, final int[] images) {
          this.context = context;
          this.productsId = productsId;
          this.values = values;
          this.images = images;
      }
  
      @Override
      public int getCount() {
          return productsId.length;
      }
  
      @Override
      public Object getItem(final int i) {
          return values[i];
      }
  
      @Override
      public long getItemId(final int i) {
          return 0;
      }
  
      @Override
      public View getView(final int i, View view, final ViewGroup viewGroup) {
          layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          if (view == null) {
              view = layoutInflater.inflate(R.layout.single_grid_item, null);
  
              //Grid Text
              final TextView gridText = view.findViewById(R.id.grid_text);
              gridText.setText(values[i]);
  
              //Grid Image
              final ImageView gridImage = view.findViewById(R.id.grid_image);
              gridImage.setImageResource(images[i]);
          }
          return view;
      }
  }
  </code></pre>