diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java index 2dbdf1f1..f0181347 100644 --- a/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java +++ b/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java @@ -221,11 +221,15 @@ public abstract class SectionAdapter<T> extends RecyclerView.Adapter<UpdateViewH moreButton = updateView.findViewById(R.id.item_more); } if(moreButton != null) { - PopupMenu popup = new PopupMenu(context, moreButton); - Menu menu = popup.getMenu(); - onItemClickedListener.onCreateContextMenu(popup.getMenu(), popup.getMenuInflater(), updateView, item); - if(menu.size() == 0) { - moreButton.setVisibility(View.GONE); + if(onItemClickedListener != null) { + PopupMenu popup = new PopupMenu(context, moreButton); + Menu menu = popup.getMenu(); + onItemClickedListener.onCreateContextMenu(popup.getMenu(), popup.getMenuInflater(), updateView, item); + if (menu.size() == 0) { + moreButton.setVisibility(View.GONE); + } else { + moreButton.setVisibility(View.VISIBLE); + } } else { moreButton.setVisibility(View.VISIBLE); } |