I am trying to implement a RecyclerView, that each item when clicked, a context menu will pop up.
I have referred the answers/comments from this question on how to to do what I wanted.
My problem is, I keep getting null by using getMenuInfo() to retrieve info. Ie, When I select an item from the context menu, this is what I get
java.lang.NullPointerException: Attempt to read from field 'long com.x.lib.RVCoursesContextMenu$RecyclerContextMenuInfo.id' on a null object reference
My code for this is very similar to this answer .
I have been looking for a solution for this for a very long time, would really appreciate if someone could help me on this.