AlphabetIndexer with Custom Adapter managed by LoaderManager

╄→尐↘猪︶ㄣ 提交于 2019-11-26 11:23:19

So I finally got this to work. Here's how i did it:

I added:

ListView lv = getListView();
lv.setFastScrollEnabled(true);
lv.setScrollingCacheEnabled(true);

to the onLoadFinished() method after the new cursor was swapped in like so

public void onLoadFinished(Loader<Cursor> loader, Cursor data) { 
 // Swap the new cursor in.  (The framework will take care of closing the
 // old cursor once we return.)
 mAdapter.swapCursor(data);

 ListView lv = getListView();
 lv.setFastScrollEnabled(true);
 lv.setScrollingCacheEnabled(true);

}

consequently these three statements were removed from the onActivityCreated() method of my custom ListFragment.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!