首页 > 代码库 > Android之输入内容监听回车键【Editor】

Android之输入内容监听回车键【Editor】

2.输入内容时按下回车键时监听


username.setOnEditorActionListener(new OnEditorActionListener() {


@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
// TODO Auto-generated method stub
Toast.makeText(MainActivity.this, "onEditorAction",1).show();
return false;
}
});

Android之输入内容监听回车键【Editor】