Last updated 11 months ago
Was this helpful?
To create a Dialog class, you should inherit it from DialogFragment from the package.
DialogFragment
class YesNoDialogFragment: DialogFragment() { // implementation // access data in arguments }
Other logic stays the same.
If you are using a ViewModel, you should inherit YesNoDialogFragment from DialogFragmentViewModel and pass the ViewModel as a parameter.
YesNoDialogFragment
DialogFragmentViewModel
class YesNoDialogFragment: DialogFragmentViewModel<YesNoViewModel>() { // implementation // access viewModel }