I have a RecyclerView, and in its adapter, I have created something similar to an OnLongClickListener, which I am calling an OnEntryLongClick
RecyclerView
OnLongClickListener
OnEntryLongClick
Pass your context correctly by casting it to Activity if you are calling from a Fragment.
In Kotlin,
AlertDialog.Builder(context as HomeActivity)