How to go to next Edit text in android after enter value in first one? -


we enter value in first edittext. want when press done button cursor move next edittext.

i tried , search on google nothing found.

you can done button click , set focus next edittext

first_edit_text.setoneditoractionlistener(new oneditoractionlistener() {              @override             public boolean oneditoraction(textview v, int actionid, keyevent event) {                   if(actionid == 0 || actionid== editorinfo.ime_action_done)                  {                      next_edit_text.requestfocus();                  }                 return false;             }       }); 

edit :

to fulfill requirement :

public void setedittext() {         edittext = new edittext[length];         (int = 0; < length; i++) {             edittext[i] = new edittext(this);             edittext[i].setid(i);             edittext[i].setsingleline();             edittext[i].setimeoptions(editorinfo.ime_action_done);             edittext[i].setoneditoractionlistener(new oneditoractionlistener() {                  @override                 public boolean oneditoraction(textview v, int actionid, keyevent event) {                     if (actionid == 0 || actionid == editorinfo.ime_action_done) {                          int current_id= v.getid();                         if((current_id+1)!=length){                                  edittext[current_id+1].requestfocus();                         }                     }                     return false;                 }             });             linear.addview(edittext[i]);         }     } 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

angularjs - ng-repeat duplicating items after page reload -