views:

31

answers:

0

Hi all,

The below is the piece of code that i have written for transferring the focus from one edit text to another, but the problem that i got with this implementation is, the focus moves to the particular edit text, and suddenly moves to the next edit text.So, i could not able to enter anything , since the focus is not at all staying that particular edit text ..

//some code comes here
// gun_pistolNotes and gun_pistolModel are two diff. editText
......
......
    gun_pistolNotes.setOnEditorActionListener(new OnEditorActionListener(){
    @Override
    public boolean onEditorAction(TextView view,int actionId, KeyEvent event){
    if(actionId == EditorInfo.IME_ACTION_UNSPECIFIED){
        gun_pistolModel.requestFocus(); // moves to this edittext and suddenly moves to another editext 
        return true;
    }
    return false;
    }
  });

......
......
//some code comes here

Any Help is Appreciated.

Thanks in advance.