title: GridView get view by position, first child view different
body: <p>Android <code>GridView</code> is quite interesting, it reuses the child views. The ones scrolled up comes back from bottom. So there is no method from <code>GridView</code> to get the child view by its position. But I really need to get view by its position and do some work on it. So to do that, I created an <code>SparseArray</code> and put views by their position in it from <code>getView</code> of <code>BaseAdapter</code>.</p>
  
  <pre><code>SparseArray&lt;View&gt; ViewArray = new SparseArray&lt;View&gt;();
  
  public View getView(int position, View convertView, ViewGroup parent) {
      View view = convertView;    
      if (view == null)
         view = li.inflate(layoutID, null);
      ViewArray.put(position, view);
  }
  </code></pre>
  
  <p>Now, I can get all visible views by their position. Everything works perfect as it should but in some devices, the first child view(position 0) is not same as the one in array. I logged the <code>getView</code> and found that for position 0, <code>getView</code> got called many times and each time array was set with different view. I have no idea why GridView is calling <code>getView</code> for position 0 many times and that happens only on few devices. Any solution ?</p>