3
I'm using this library使用刷卡进行listview视图关闭功能。android刷卡关闭listview不会删除项目
我使用的是ArrayAdapter并使用此代码创建一个滑动将其关闭监听
SwipeDismissListViewTouchListener touchListener =
new SwipeDismissListViewTouchListener(
listView,
new SwipeDismissListViewTouchListener.DismissCallbacks() {
@Override
public boolean canDismiss(int position) {
return true;
}
@Override
public void onDismiss(ListView listView, int[] reverseSortedPositions) {
for (int position : reverseSortedPositions) {
mAdapter.remove(mAdapter.getItem(position));
}
mAdapter.notifyDataSetChanged();
}
});
listView.setOnTouchListener(touchListener);
// Setting this scroll listener is required to ensure that during ListView scrolling,
// we don't look for swipes.
listView.setOnScrollListener(touchListener.makeScrollListener());
但每次试图刷卡好像它的工作,但时间,那么该项目回来。
日志猫不会给我任何例外。
以前有没有人有过这个错误?请帮忙。