title: IndexOutOfBoundsException in getItemId in Android baseAdapter
body: <p>I have a custom base adapter to work with my ArrayList of customObjects. There's a small chance that my data set is changing in the background when the user enters my listView and it seems to be causing my IndexOutOfBoundsException. I'm currently doing:</p>
  
  <pre><code>@Override
  public long getItemId(int position) {
  
      return custom.get(position).getID();
  
  }
  </code></pre>
  
  <p>Should I just stick to returning the position from like ArrayAdapter?</p>
  
  <pre><code>/**
       * {@inheritDoc}
       */
      public long getItemId(int position) {
          return position;
      }
  </code></pre>
  
  <p>I could just catch this error, but I'm not sure what to do in the catch. I need to return something, but I'm afraid to return something like -1 or 0.</p>
  
  <p>In this question: <a href="https://stackoverflow.com/questions/6711592/what-is-the-intent-of-the-methods-getitem-and-getitemid-in-the-android-class-bas">What is the intent of the methods getItem and getItemId in the Android class BaseAdapter?</a></p>
  
  <p>People say that ArrayAdapter returns -1, but that's not the case (as of March 2014 at least).</p>