Please explain me the issue about soft keyboard. For example, I have an EditText on my activity or dialogfragment or fragmentactivity, whatever. here it is:
This is what worked for me -
Create your own EditText class and override following method -
public class FocussableEditText extends EditText {
public FocussableEditText(Context context) {
super(context);
}
public FocussableEditText(Context context, AttributeSet attrs) {
super(context, attrs);
}
public FocussableEditText(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
super.onWindowFocusChanged(hasWindowFocus);
if (hasWindowFocus) {
InputMethodManager imm = (InputMethodManager)getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(this, InputMethodManager.SHOW_FORCED);
}
}
}
http://debuggingisfun.blogspot.in/2014/08/android-show-soft-keyboard.html