📅  最后修改于: 2022-03-11 14:52:27.791000             🧑  作者: Mango
int guessValue;
//Try-Catch to Catch any Kind of Error from editText
try {
guessValue = Integer.parseInt(editText.getText().toString());
}catch (Exception e)
{
Toast.makeText(this,"Please Enter a Valid Number",Toast.LENGTH_LONG).show();
return;
}