Created
November 27, 2014 12:28
-
-
Save AfonsoFGarcia/e7cd7d33653058a98b50 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
AlertDialog.Builder alert = new AlertDialog.Builder(this, AlertDialog.THEME_HOLO_LIGHT); | |
alert.setTitle(title); | |
alert.setCancelable(false); | |
AlertDialog dialog; | |
// Set an EditText view to get user input | |
final EditText input = new EditText(this); | |
alert.setView(input); | |
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() { | |
public void onClick(DialogInterface dialog, int whichButton) { | |
//noinspection ConstantConditions | |
playerName = input.getText().toString(); | |
if (playerName.equals("")) { | |
getName("Enter a valid name"); | |
} else { | |
TextView player = (TextView) findViewById(R.id.playerName); | |
player.setText(playerName); | |
register(playerName); | |
while (me == null) { | |
} | |
setPoints(me.getScore().toString()); | |
g.beginGame(); | |
dialog.dismiss(); | |
} | |
} | |
}); | |
dialog = alert.create(); | |
dialog.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment