Created
February 10, 2013 06:20
-
-
Save antew/4748610 to your computer and use it in GitHub Desktop.
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
@Override | |
public Dialog onCreateDialog(Bundle savedInstanceState) { | |
// Get the username from the arguments, if one isn't passed | |
// we use a blank string so it still looks OK | |
String username = ""; | |
if (getArguments().containsKey(USERNAME)) | |
username = ", " + getArguments().getString(USERNAME); | |
// "Are you sure you want to log out, <username>?" | |
String message | |
= getString(R.string.are_you_sure_you_want_to_log_out) + | |
username + | |
"?"; | |
AlertDialog.Builder b = new AlertDialog.Builder(getActivity()); | |
b.setTitle(R.string.log_out); | |
b.setMessage(message) ; | |
b.setPositiveButton(R.string.yes, this); | |
b.setNegativeButton(R.string.no, this); | |
return b.create(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment