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】
原文:http://www.cnblogs.com/jzssuanfa/p/7072625.html