Created
June 20, 2014 05:52
-
-
Save laaptu/69feda113d417b618cc9 to your computer and use it in GitHub Desktop.
Using dialog fragment to show dialog
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
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