EditText t = (EditText)findViewById(R.id.numero);
String tent = t.getText().toString();
try {
int tentativo = Integer.parseInt(tent);
...
} catch (Exception e) {
}
if (tentativo == daIndovinare) {
vincita ();
Toast.makeText(getApplicationContext(),getResources().getString(<ID messaggio>), Toast.LENGTH_SHORT).show();
numProve ++;
t.setText("");
Per incrementare il numero di prove e svuotare il campo.