Created
December 12, 2018 10:04
-
-
Save DawnImpulse/71aa88786b0f3c5d56d578ad0c8345e6 to your computer and use it in GitHub Desktop.
Custom dialog box
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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