我的代码:
if(!"".equals(et1.getText().toString())){
Toast.makeText(getActivity(), "Please enter text1", Toast.LENGTH_SHORT).show();
} else if(!"".equals(et2.getText().toString())){
Toast.makeText(getActivity(), "Please enter text2", Toast.LENGTH_SHORT).show();
} else if(!"".equals(et3.getText().toString())){
Toast.makeText(getActivity(), "Please enter text3", Toast.LENGTH_SHORT).show();
} else if(!"".equals(et4.getText().toString())){
Toast.makeText(getActivity(), "Please enter text4", Toast.LENGTH_SHORT).show();
} else if(!"".equals(et5.getText().toString())){
Toast.makeText(getActivity(), "Please enter text5", Toast.LENGTH_SHORT).show();
}
//总共 13 个字段,所以这将接近 13 个检查。所以我只想知道是否有可能检查一个声明并找到哪个文件被留空。
谢谢你。