From fdf993a66361ec86bf146b3b34851c461fc724ae Mon Sep 17 00:00:00 2001 From: renlinx007 Date: Mon, 11 May 2015 19:55:13 +0530 Subject: [PATCH] adjust setadapter for setEmptyView --- .../src/com/baoyz/swipemenulistview/SwipeMenuListView.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/src/com/baoyz/swipemenulistview/SwipeMenuListView.java b/library/src/com/baoyz/swipemenulistview/SwipeMenuListView.java index be4e8ae..cff9c1a 100644 --- a/library/src/com/baoyz/swipemenulistview/SwipeMenuListView.java +++ b/library/src/com/baoyz/swipemenulistview/SwipeMenuListView.java @@ -59,6 +59,8 @@ private void init() { @Override public void setAdapter(ListAdapter adapter) { + + if(adapter != null){ super.setAdapter(new SwipeMenuAdapter(getContext(), adapter) { @Override public void createMenu(SwipeMenu menu) { @@ -80,6 +82,9 @@ public void onItemClick(SwipeMenuView view, SwipeMenu menu, } } }); + }else{ + super.setAdapter(adapter) + } } public void setCloseInterpolator(Interpolator interpolator) {