SwipeToDismissTouchListener touchListener =
new SwipeToDismissTouchListener<>(
new RecyclerViewAdapter(recyclerView),
new SwipeToDismissTouchListener.DismissCallbacks() {
@Override
public boolean canDismiss(int position) {
return true;
}
@Override
public void onDismiss(RecyclerViewAdapter view, int position) {
Users.remove(position);
mAdapter.notifyItemRemoved(position);
}
});
Caused by: java.lang.NullPointerException
at com.hudomju.swipe.adapter.RecyclerViewAdapter.getContext(RecyclerViewAdapter.java:19)
at com.hudomju.swipe.SwipeToDismissTouchListener.<init>(SwipeToDismissTouchListener.java:143)
I am getting a Null Pointer Exception
SwipeToDismissTouchListener touchListener =
new SwipeToDismissTouchListener<>(
new RecyclerViewAdapter(recyclerView),
new SwipeToDismissTouchListener.DismissCallbacks() {
@Override
public boolean canDismiss(int position) {
return true;
}
@Override
public void onDismiss(RecyclerViewAdapter view, int position) {
Users.remove(position);
mAdapter.notifyItemRemoved(position);
}
});