Skip to content

Instantly share code, notes, and snippets.

@5AbhishekSaxena
Created June 5, 2023 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 5AbhishekSaxena/fa9c52d47f597099dd1410990a6f2c52 to your computer and use it in GitHub Desktop.
Save 5AbhishekSaxena/fa9c52d47f597099dd1410990a6f2c52 to your computer and use it in GitHub Desktop.
private fun buildSimpleDialog(): AlertDialog {
return MaterialAlertDialogBuilder(this)
.setTitle("Delete Task")
.setPositiveButton(
"Delete"
) { _, _ -> Toast.makeText(this, "Delete clicked", Toast.LENGTH_SHORT).show() }
.setNegativeButton(
"Cancel"
) { _, _ -> Toast.makeText(this, "Cancel clicked", Toast.LENGTH_SHORT).show() }
.setCancelable(true)
.setMessage("Are you sure that you would like to delete the task?")
.setIcon(R.drawable.ic_baseline_delete_24)
.create()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment