If you don't have access to a third-party input device, click the button and then just find your buttons and then:
Button.performclick ();
You can do it.
So if you use a third-party input method, there are times when listening is not so easy:
The following scenarios are:
External input service, just throw me a string of characters, I get the character after the Execute button event
The code is as follows:
edittext1.addtextchangedlistener (New textwatcher () { @Override public void aftertextchanged (editable s) {          LOG.D (tag, "aftertextchanged"); } @Override public void beforetextchanged (charsequence s, int start, int count, int&nBsp;after) {  LOG.D (tag, "beforetextchanged:" + s + "-" + start + "-" + count + "-" + after); } @Override public void ontextchanged ( charsequence s, int start, int before, int count) { if (S.length () >5) {               LOG.D (TAG, " OnTextChanged: " + s + "-" + "-" + start + "-" + before + "-" + count); toast.maketext (context, s + "", Toast.LENGTH_LONG). Show ();// EditText editText3 = (EditText) findviewbyid (r.id.et_3); Button button = (Button) findviewbyid (r.id.bu_1); &nBsp; button.performclick (); } } });
It is important to note that
OnTextChanged
Method must give a qualified parameter, otherwise it will continue to execute, forming a dead loop, the program will exit unexpectedly.
I'm writing it here.
if (S.length () >5)
Android to implement button click events by listening EditText