Sorry to ask you again for help on this, but all the other posts did not help.
Here's the scenario: I have Acivity ('A'), which includes a layout with a fragment inside. This fragment is replaced with user input. One of these snippets has an edittext inside, which I want to focus on creating and showing a damn soft keyboard. So, in the onCreateView () fragment I use:
mEt = (EditText) v.findViewById(R.id.et); mEt.setImeOptions(EditorInfo.IME_ACTION_DONE); mEt.requestFocus();
So, it works for the first time, but if a fragment is replaced and re-created later, it gets focus, but the keyboard does not appear.
I tried to hide the keyboard before the fragment was destroyed with:
InputMethodManager keyboard = (InputMethodManager) ctx.getSystemService(Context.INPUT_METHOD_SERVICE); keyboard.hideSoftInputFromWindow(et.getWindowToken(), 0);
or to explicitly display the keyboard using:
InputMethodManager keyboard = (InputMethodManager) ctx.getSystemService(Context.INPUT_METHOD_SERVICE); keyboard.showSoftInput(et, 0);
but (as you can imagine from what I'm posting here :)), the problem remains.
I also desperately thought about the activity / fragment problem and used the same methods as the listeners in action, with no luck.
Pretty upset, please help :)