Created
October 16, 2014 08:18
-
-
Save louisbl/11e2d56d8e4754290e51 to your computer and use it in GitHub Desktop.
Android Alert Dialog
This file contains hidden or 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
AlertDialog.Builder builder = new AlertDialog.Builder(this); | |
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
} | |
}); | |
builder.setNegativeButton("CANCEL", null); | |
TextView view = new TextView(this); | |
view.setText("A dialog"); | |
view.setPadding(20, 20, 20, 20); | |
view.setGravity(Gravity.FILL_HORIZONTAL); | |
view.setTextSize(18); | |
builder.setView(view); | |
builder.setTitle("Dialog title"); | |
builder.create().show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment