Skip to content

Instantly share code, notes, and snippets.

@rainyear
Created May 27, 2014 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rainyear/010858f9eca1817e766e to your computer and use it in GitHub Desktop.
Save rainyear/010858f9eca1817e766e to your computer and use it in GitHub Desktop.
private void checkInput() {
input = (EditText) findViewById(R.id.passpwd);
input2 = (EditText) findViewById(R.id.passpwd2);
submit = (Button) findViewById(R.id.submit);
imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
// imm.showSoftInput(null, 0);
submit.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
String input_txt = input.getText().toString();
String input_txt2 = input2.getText().toString();
if (!input_txt.equals(input_txt2) || input_txt.length() == 0) {
Toast.makeText(SetLock.this, "請輸入相同的密碼!", Toast.LENGTH_SHORT)
.show();
return;
}
// if (input_txt.length() != 3 || input_txt2.length() != 3) {
// Toast.makeText(SetLock.this, "請輸入三位數字!", Toast.LENGTH_SHORT)
// .show();
// return;
// }
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment