扫描头开启,并发送回车
txtUsername.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView arg0, int arg1, KeyEvent arg2) {
if(arg2.getKeyCode()==KeyEvent.KEYCODE_ENTER){
// TODO Auto-generated method stub
txtPassword.setText("xxxx");
return true;
}
return false;
}
});
<EditText
android: >