vendredi 6 février 2015

Android onScrollStateChanged fires twice after having reached bottom


Vote count:

0




I'm trying to detect when a user has gotten to the end of the listview. All of the posts on here have said to use onScrollStateChanged or onScroll. The problem I am having with this is that the onScrollStateChanged will print out twice instead of once (depends on how many items there are in the listview).



if (timeline_arg.size() != 0)
{
if (mListView.getLastVisiblePosition() == mListView.getAdapter().getCount() -1
&& mListView.getChildAt(mListView.getChildCount() -1).getBottom() <= mListView.getHeight())
{
if (!swipeRefreshLayout.isRefreshing())
{
List<Status> test = loadOlderTweets();
insertTimeline(test, "true");
}
}
}


asked 21 secs ago







Android onScrollStateChanged fires twice after having reached bottom

Aucun commentaire:

Enregistrer un commentaire