Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had a very similar issue. Fragment A calls fragment B where fragment B (Layout with TABS) has EditText in it. The keyboard would not come up for this EditText box unless I clicked on something else.</p> <p>I tried the solution here, and on many other stackoverflow solutions. <strong>MANY.</strong> The only one that worked for me was to clear focus on the EditText when the EditText was clicked. In OnFocusChangeListener I was able to force the keyboard open and closed.</p> <p>This issue only occurred for me on Android 2.34 devices and not 2.2, or 3.0. Emulator had no issues as well. Manifest only had adjustResize in it.</p> <p>So here's a solution that worked for me(hopefully someone else finds this useful):</p> <p><em>In onCreateView(...)</em></p> <pre><code> // //Inflate Your Layout Here // //set on focus to force keyboard editText.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { Log.d(TAG,"On Foucs. Has Focus = " + hasFocus); if (hasFocus) { //open keyboard ((InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(v, InputMethodManager.SHOW_FORCED); } else { //close keyboard ((InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow( v.getWindowToken(), 0); } } }); //Set on click listener to clear focus editText.setOnClickListener(new OnClickListener() { @Override public void onClick(View clickedView) { clickedView.clearFocus(); clickedView.requestFocus(); } }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload