// The public interface is used to send information back to the parent activity.
interface AddDomainListener {
fun onAddDomain(dialogFragment: DialogFragment)
}
// The public interface is used to send information back to the parent activity.
interface AddDomainListener {
fun onAddDomain(dialogFragment: DialogFragment)
}
// Set the view. The parent view is `null` because it will be assigned by the alert dialog.
dialogBuilder.setView(requireActivity().layoutInflater.inflate(R.layout.add_domain_dialog, null))
// Set the view. The parent view is `null` because it will be assigned by the alert dialog.
dialogBuilder.setView(requireActivity().layoutInflater.inflate(R.layout.add_domain_dialog, null))
dialogBuilder.setPositiveButton(R.string.add) { _: DialogInterface, _: Int ->
// Return the dialog fragment to the parent activity on add.
addDomainListener.onAddDomain(this)
dialogBuilder.setPositiveButton(R.string.add) { _: DialogInterface, _: Int ->
// Return the dialog fragment to the parent activity on add.
addDomainListener.onAddDomain(this)