问题
When the user scrolls quickly through items, it seems superfluous to start requesting images to populate those items. Afterall, the user is scrolling so fast, they will never be downloaded/shown in time. Is there any kind of method/event that first fires when the user has actually paused scrolling?
回答1:
Try this code to detect scrolling stop :
setOnScrollListener(new OnScrollListener()
{
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)
{
// TODO Auto-generated method stub
}
public void onScrollStateChanged(AbsListView view, int scrollState)
{
// TODO Auto-generated method stub
if(scrollState == 0)
Log.i("a", "scrolling stopped...");
}
});
来源:https://stackoverflow.com/questions/18826465/android-listview-only-load-images-into-items-when-user-stops-scrolling