edit2.setOnKeyListener (new OnKeyListener () {
public boolean onKey (View v, int keyCode, KeyEvent event) {
if (keyCode! = 66) / / 66 is the Enter key
{
return false;
}
edittext2 = edit2.getText () toString ();.
textview.setText (edittext2);
}
});
Thus, textview will perform twice, setText twice, is not because of the original carriage will run once or twice
executed this onKey
Reply:
Other places call textview.setText () instead. Interrupted point look
Reply:
You can pass this code is compiled, no return.
Reply:
Down and Up Key events have, of course, will run twice.
Reply:
Thank you very much upstairs

et_searchContent.setOnKeyListener (new OnKeyListener () {
@ Override
public boolean onKey (View arg0, int arg1, KeyEvent arg2) {
/ / TODO Auto-generated method stub
System.out.println ();
if (arg1 == KeyEvent.KEYCODE_ENTER
&& Arg2.getAction () == KeyEvent.ACTION_DOWN) {
No comments:
Post a Comment