我有多个EditTexts
. 我如何验证是否EditText
有“”,EditText
如果EditText
是“”,那么我希望用户在进入edittext2之前必须输入一个数字怎么做?
case R.id.P2Throw1Set2:
p212r.setText(String.valueOf(Integer.parseInt(p2score.getText().toString()) - Integer.parseInt(p212.getText().toString())));
p2score.setText(String.valueOf(Integer.parseInt(p212r.getText().toString())));
break;
case R.id.P2Throw2Set2:
p222r.setText(String.valueOf(Integer.parseInt(p2score.getText().toString()) - Integer.parseInt(p222.getText().toString())));
p2score.setText(String.valueOf(Integer.parseInt(p222r.getText().toString())));
break;
case R.id.P2Throw3Set2:
p232r.setText(String.valueOf(Integer.parseInt(p2score.getText().toString()) - Integer.parseInt(p232.getText().toString())));
p2score.setText(String.valueOf(Integer.parseInt(p232r.getText().toString())));
break;
case R.id.P2Throw4Set2:
p242r.setText(String.valueOf(Integer.parseInt(p2score.getText().toString()) - Integer.parseInt(p242.getText().toString())));
p2score.setText(String.valueOf(Integer.parseInt(p242r.getText().toString())));
break;