title: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 only once
body: <p>I got the following exception only once at <code>getItem</code> of adapter.Maybe it was a device or connection problem but my app crashed.How can i make sure that my app doen't crashes with this exception if there is problem in device?</p>
  
  <pre><code> java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
  </code></pre>
  
  <p>adapter</p>
  
  <pre><code>   @Override
          public Object getItem(int position) {
              return items.get(position);
          }
  </code></pre>