0

I have a Spinner in which the dropdown items have a EditText, after trying editText.requestFocus(),the focus comes up on the editText, but the keyboard is not showing up. It tells mServedView != view, which I basically think that the dropdown item is not attached to the parent activity maybe. Following is my code.

 InputMethodManager imm = (InputMethodManager) 
               appContext.getSystemService(Context.INPUT_METHOD_SERVICE);
  imm.showSoftInput(holder.editText, InputMethodManager.SHOW_FORCED);

I have tried using toggleSoftInput, in that case the keyboard shows up, but as I type the first key, the dropdown closes.

Akshay Shenoy
  • 1,194
  • 8
  • 10
  • I'm not sure but It's something related to focus, when you're using spinner it has it's own focus and edittext inside it also trying to get focus, but at any given time only one element can have focus. It's a hint, do research about it. – Parag Pawar Jul 16 '20 at 08:43
  • I tried `android:focusable="false"` in my Spinner XML, still the issue persists, i think the dropdown view and the view where I am trying to call the keyboard are not same. Just way too confused. – Akshay Shenoy Jul 16 '20 at 09:14
  • Any update on this question? Would like to get some help on this. – Akshay Shenoy Jul 20 '20 at 04:22

0 Answers0