Skip to content

Instantly share code, notes, and snippets.

@manuelernesto
Created August 20, 2020 22:33
Show Gist options
  • Save manuelernesto/2120ff3c94cb980ef2c3b1ccc7b24a41 to your computer and use it in GitHub Desktop.
Save manuelernesto/2120ff3c94cb980ef2c3b1ccc7b24a41 to your computer and use it in GitHub Desktop.
private fun apagarPalestrante() {
AlertDialog.Builder(requireContext()).apply {
setTitle("Deseja realmente apagar?")
setNegativeButton("Não") { _, _ ->
}
setPositiveButton("Sim") { _, _ ->
launch {
context.let {
PalestranteDB.getDatabase(it).dao().apagar(mPalestrante!!)
val action = SpeakersFragmentDirections.toHomeFragment()
Navigation.findNavController(requireView()).navigate(action)
}
}
}
}.create().show()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment