我想在我的ListView中添加一个侦听器,它可以检测到用户何时触发了放纵。我已经有了一个滚动监听器,但希望在用户决定离开当前位置时执行后台操作。
谢谢,劳伦斯
发布于 2011-11-29 09:33:24
尝试ListView的OnScrollListener并监听SCROLL_STATE_FLING。
@Override
public void onScrollStateChanged(AbsListView absListView, int scrollState) {
if(scrollState == SCROLL_STATE_FLING) {
// Control reaches here on fling
}
}发布于 2015-12-09 14:44:25
模拟目标视图的action_down事件:
view.dispatchTouchEvent(
MotionEvent.obtain(System.currentTimeMillis(),
System.currentTimeMillis() + 100,
MotionEvent.ACTION_DOWN, 0.0f, 0.0f, 0));https://stackoverflow.com/questions/8304446
复制相似问题