android: AbsListView.OnScrollListener SCROLL_STATE_IDLE is not called after SCROLL_STATE_TOUCH_SCROL

Posted by Francesco on Stack Overflow See other posts from Stack Overflow or by Francesco
Published on 2010-06-09T12:41:07Z Indexed on 2010/06/09 12:42 UTC
Read the original article Hit count: 1181

I have a problem with android version 2.1. It looks like a bug.

I attached an OnScrollListener to my listView.

I'm using the method onScrollStateChanged(AbsListView view, int scrollState) for monitoring the scroll's state of my listview.

The scrollstate could assume 3 value (taken from the documentation):

  1. SCROLL_STATE_FLING: The user had previously been scrolling using touch and had performed a fling. The animation is now coasting to a stop
  2. SCROLL_STATE_IDLE:The view is not scrolling. Note navigating the list using the trackball counts as being in the idle state since these transitions are not animated.
  3. SCROLL_STATE_TOUCH_SCROLL:The user is scrolling using touch, and their finger is still on the screen

I assume that the SCROLL_STATE_IDLE will always be passed after one of other two states. It's always true excepted for android version 2.1. SCROLL_STATE_IDLE is not passed after SCROLL_STATE_TOUCH_SCROLL The problem happens also if you stop the fling by a touch instead of let the scroll stop by itself. This strange behaviour leaves my listView in an unconsistate state.

Someonelse has the same problem? Suggestion for a "not-so-dirty" work around?

© Stack Overflow or respective owner

Related posts about android

Related posts about android-sdk-2.1