Skip to content

Instantly share code, notes, and snippets.

@DawnImpulse
Created December 12, 2018 10:04
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 DawnImpulse/71aa88786b0f3c5d56d578ad0c8345e6 to your computer and use it in GitHub Desktop.
Save DawnImpulse/71aa88786b0f3c5d56d578ad0c8345e6 to your computer and use it in GitHub Desktop.
Custom dialog box
val factory = LayoutInflater.from(this)
val deleteDialogView = factory.inflate(R.layout.mylayout, null)
val deleteDialog = AlertDialog.Builder(this).create()
deleteDialog.setView(deleteDialogView)
// anything you wish to do on views
deleteDialogView.findViewById(R.id.yes).setOnClickListener(object:OnClickListener() {
fun onClick(v:View) {
//your business logic
deleteDialog.dismiss()
}
})
deleteDialog.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment