android - Event on EditText -


i have 1 edittext name eid ..now want user enter eid value ..an edittext "oid" oid should automatically generate it's value out of value entered in eid ..so event should use perform above task.. plz new in android

you can use textwatcher on edit text, gets changes in edit text, , triggers appropriate functions.

eid.addtextchangedlistener(new textwatcher() {     public void ontextchanged(charsequence s, int start, int before, int count) {      }     public void beforetextchanged(charsequence s, int start, int count, int after) {      }      public void aftertextchanged(editable s) {         // set oid value         oid.settext(eid.gettext().tostring());     } }); 

whenever text change of "eid" method aftertextchanged called , set value of oid also.


Comments

Popular posts from this blog

Python __call__ special method practical example -

arrays - jQuery - Retrieve values from HTML elements and return their sum -