radioButton1.getText().toString().equals("")
下面的代码中的错误是什么?
我想强制用户填写此字段,如果他将该字段留空,则发送一条填写必填字段的消息。我该怎么做呢?
page1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if(radioButton1.getText().toString().equals("")||radioButton2.getText().toString().equals("")||radioButton3.getText().toString().equals("")||radioButton4.getText().toString().equals("")
||petn.getText().toString().equals("")||breed.getText().toString().equals("")||color.getText().toString().equals("")||alergic.getText().toString().equals("")||ath_locat.getText().toString().equals("")||d_condi.getText().toString().equals("")||weight1.getText().toString().equals("")
)
{
Log.e("onclick", ",pd");
Toast msg = Toast.makeText(
My2Activity.this,"Please fill the * required field",Toast.LENGTH_LONG);
msg.show();
}
else{
PostData();
Intent d = new Intent(getApplicationContext(),
My1Activity.class);
startActivity(d);
}
}
});