title: Android ListView adapter.notifyDataSetChanged sometimes works, sometimes doesn't
body: <p>Have a frustrating problem with the adapter for Android ListView</p>
  
  <p>I have this chunk of code:</p>
  
  <pre><code>@Override
  public void onClick(View v, MotionEvent event, int position) {
      int value = dice.get(position).roll();
      adapter.notifyDataSetChanged();
      Toast.makeText(getApplicationContext(), "Click on "+position + " | Output: "+value, Toast.LENGTH_SHORT).show();
  }
  </code></pre>
  
  <p>Where <code>dice</code> is an ArrayList of custom objects and <code>adapter</code> is an extension of <code>ArrayAdapter</code>. The Toast is <em>always</em> visible when clicking the view, but the ListView only updates sporadically. I can see no pattern to it; sometimes the view updates on click, sometimes after 2 or 3.</p>
  
  <p>Any ideas? Thanks</p>