Skip to content

Commit

Permalink
Fix Popup Menu Crash (#6)
Browse files Browse the repository at this point in the history
* Correct view initialization using recyclerview viewholder

Signed-off-by: chankruze <chankruze@gmail.com>
  • Loading branch information
chankruze authored Jun 21, 2019
1 parent 6f2c795 commit edaf247
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ public void onItemClick(int position) {

@Override
public void onShareClick(int position) {
View viewMore = mRecyclerView.getChildAt(position).findViewById(R.id.post_more);
RecyclerView.ViewHolder viewMoreHolder = mRecyclerView.findViewHolderForLayoutPosition(position);
View viewMore = viewMoreHolder.itemView.findViewById(R.id.post_more);
showPopup(getActivity(), viewMore, posts, position);
}
});
Expand Down

0 comments on commit edaf247

Please sign in to comment.