Skip to content

Instantly share code, notes, and snippets.

@DawnImpulse
Created December 13, 2017 14:04
Show Gist options
  • Save DawnImpulse/bcde515eb3cc85641dac11f88ae42137 to your computer and use it in GitHub Desktop.
Save DawnImpulse/bcde515eb3cc85641dac11f88ae42137 to your computer and use it in GitHub Desktop.
AlertDialog dialog = null;
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
final EditText editText;
dialogBuilder.setTitle("Edit Balance ");
LayoutInflater inflater = getLayoutInflater();
View dialogView = inflater.inflate(R.layout., null);
dialogBuilder.setView(dialogView);
editText = (EditText) dialogView.findViewById(R.id.alert_edit_text);
dialogBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
dialogBuilder.setNegativeButton("CANCEL", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
dialog = dialogBuilder.create();
dialog.show();
final AlertDialog finalDialog = dialog;
dialog.getButton(DialogInterface.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
}
});
dialog.getButton(DialogInterface.BUTTON_NEGATIVE).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finalDialog.dismiss();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment