Skip to content Skip to sidebar Skip to footer

How Come The Android Soft Keyboard Is Not Responding To Edittext?

I have a SherlockFragmentActivity and a SherlockFragment that is within a TabManager. In this Fragment I have RadioButtons, CheckBoxes, a Button and an EditText in a LinearLayout.

Solution 1:

You can register a focus listener for your edittext and open soft keyboard when it get focus:

edit_Text.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
    if(hasFocus){
        ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE))
.showSoftInput(edit_Text, InputMethodManager.SHOW_FORCED);
    }else
        Toast.makeText(getApplicationContext(), "lost the focus", 2000).show();
}
});

Edit: For emulator,I think that it is not guaranteed.Really I did not any way to appear soft keyboard programmatically.Some times it appears and some times not.In emulator with android 4.0.3,you can see a symbol in notification bar instead of appearing soft keyboard: enter image description here

Look at: Event for Handling the Focus of the EditTextForcing the Soft Keyboard open

Post a Comment for "How Come The Android Soft Keyboard Is Not Responding To Edittext?"