Last active
September 23, 2019 07:30
-
-
Save sandeepyohans/32f1c83eaaac253f26acd2a5566ec39f to your computer and use it in GitHub Desktop.
Add Custom Layout to AlertDialog Android
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
public void showCustomAlert() { | |
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context); | |
LayoutInflater inflater = this.getLayoutInflater(); | |
View dialogView = inflater.inflate(R.layout.update_layout, null); | |
dialogBuilder.setView(dialogView); | |
EditText etName = (EditText) dialogView.findViewById(R.id.etName); | |
AlertDialog alertDialog = dialogBuilder.create(); | |
alertDialog.show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment