How to provide activity or application context in Hilt to ViewModel?
Hello I have a button in recyclerview, I would like to show dialog when in one element of recyclerview the button is clicked.
I have done:
in Adapter:
class SetGoalsAdapter(
private val onItemDeleteClicked: (Int) -> Unit,
private val onItemRootClicked: (Int) -> Unit,
private val onButtonClickedListener: (Int) -> Unit)
[...more code...]
btnQuestion.setOnClickListener() {
onButtonClickedListener(item.id)
}
in VM:
@HiltViewModel...