0

IDK but i am continuously getting this issue To make request focus on EditText when Keyboard next button is pressed in adapter.

I have set the android:imeOptions="actionNext" in my adapter layout. When i am on first item of 'ListView' then its is working fine.

But when i press next from the keyboard. It goes to next position of EditText in ListView which is perfect but the EditText is not getting the requestFocus() and same problem with other next item.

I tired all the solutions i found out in stackoverflow . But i think i am unable to find out the best solution.

Could you please help me out.

Any help will deeply appriciated. Please check the screenshots below.

EditText is not getting requestFocus()

Mamta Kaundal
  • 373
  • 1
  • 5
  • 22

1 Answers1

0

May be this will helps you :-

txtUserid.setOnKeyListener(new OnKeyListener() {

    public boolean onKey(View v, int keyCode, KeyEvent event) {
          // If the event is a key-down event on the "enter" button
          if ((event.getAction() == KeyEvent.ACTION_DOWN) &&
               (keyCode == KeyEvent.KEYCODE_ENTER))
          {
                // Perform action on Enter key press
                txtone.clearFocus();
                txtsecond.requestFocus();
                return true;
          }
          return false;
    }
});
Rajesh Satvara
  • 3,842
  • 2
  • 30
  • 50
  • My EditText is in adapter, and i am inflating the layout for the number of items. i tried out this also but its not working. Its only a one EditText which is used for number of items. The edittext is equal to the data coming from the server. – Mamta Kaundal Feb 05 '16 at 06:03
  • OK let me try more on it. thank you for support and welcome here. we are all for you . :) – Rajesh Satvara Feb 05 '16 at 06:05
  • Yes please help me out of this because i am stuck here for too many days. – Mamta Kaundal Feb 05 '16 at 06:48