Skip to content

Instantly share code, notes, and snippets.

@laaptu
Created June 20, 2014 05:52
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 laaptu/69feda113d417b618cc9 to your computer and use it in GitHub Desktop.
Save laaptu/69feda113d417b618cc9 to your computer and use it in GitHub Desktop.
Using dialog fragment to show dialog
DialogFragment dg = new DialogFragment() {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
return new AlertDialog.Builder(getActivity())
.setMessage(R.string.submit_confirm_message)
.setPositiveButton(R.string.submit_confirm_button, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
/*---THIS IS ADDED EXTRA--------*/
postInfoToServer();
}
})
.setNegativeButton(android.R.string.cancel, null)
.create();
}
};
dg.show(getSupportFragmentManager(), "place_order_dialog");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment