title: Android: onScrollStateChanged SCROLL_STATE_IDLE sometimes doesn't fire
body: <p>I'm running into a bit of a problem. What I'm doing: I've got a ListView which has got some images in it. To make the scrolling smoother I've disabled the images to show up when scrolling. Now there seems to be a <a href="http://code.google.com/p/android/issues/detail?id=5086" rel="noreferrer">bug</a> in Android which sometimes causes the scroll state to not change back from SCROLL_STATE_FLING back to SCROLL_STATE_IDLE, which causes my images to not show up again. </p>
  
  <p>My first thought was to set an onTouchListener and check when I get ACTION_UP, but that doesn't help because the SCROLL_STATE_FLING  state is obviously being set after that. So now I've thought I could start a timer when the SCROLL_STATE_FLING state is being set and check after some time if the state is still in fling mode and then invalidate my view. But I don't think that's a very good solution.</p>
  
  <p>Does anyone have a better idea on how I could do that? I've seen <a href="https://stackoverflow.com/questions/3005811/android-abslistview-onscrolllistener-scroll-state-idle-is-not-called-after-scro/7369067#7369067">this</a> reply but I need a solution for API level &lt; 9 (plus it also sometimes happen when it's not overscrolling)</p>
  
  <p>Here's my code for that:</p>
  
  <pre><code>    mList.setOnScrollListener(new OnScrollListener() {
  
          @Override
          public void onScrollStateChanged(AbsListView view, int scrollState) {
              mListAdapter.setIsScrolling(scrollState != SCROLL_STATE_IDLE);
              Log.i(this, "scrollStateChanged" + scrollState);
              if (scrollState == SCROLL_STATE_IDLE) {
                  mList.invalidateViews();
              }
          }
  
          @Override
          public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
          }
      });
  </code></pre>
  
  <p>Thanks,
  Maria</p>