这是登录设置的代码,以便进入设置页面。onClickView 报错,必须在 Setting 类中实现。有什么建议或解决方案吗?
public class Setting1 extends Settings implements OnClickListener{
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.pass_set);
EditText et = (EditText)findViewById(R.id.passwordedittext);
Button buttonEnter = (Button)findViewById(R.id.sumbitbutton);
buttonEnter.setOnClickListener(this);
}
@Override
public void onCLick(View v){
EditText et = (EditText)findViewById(R.id.passwordedittext);
String password = et.getText().toString();
et.getEditableText().toString();
if(password.equals("Password")){
Intent intent = new Intent(Setting1.this, Settings.class);
startActivity(intent);
}
else{
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("YOU SUCK!");
builder.setMessage("Try Again!");
builder.setPositiveButton("OK", null);
AlertDialog dialog = builder.show();
}
}
}