每当我们执行以下代码时,只有一个语句一直被调用,它是完整的文本字段。请告诉我什么问题..
public void save_record()
{
final String name_val = name.getText().toString();
final String pass_val = password.getText().toString();
final String cpass_val = cpassword.getText().toString();
save.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
if(name_val.equals("") || pass_val.equals("") || cpass_val.equals(""))
{
Toast.makeText(getApplicationContext(), "Complete Text Field",Toast.LENGTH_LONG).show();
}
else
{
if(pass_val!=cpass_val)
{
Toast.makeText(getApplicationContext(), "password not Match", Toast.LENGTH_LONG).show();
}
else
{
db.insert(name_val, cpass_val);
db.close();
Toast.makeText(getApplicationContext(), "save", Toast.LENGTH_LONG).show();
}
}
}
});
}