Search code examples
androidandroid-emulatorandroid-2.3-gingerbreadandroid-keypad

Android Emulator - Cannot get keyboard to display


Basically I cannot get the onscreen keyboard to display at all.

I've tried every solution I've read to make it appear within my application, and now I've come to the conclusion that it must be the emulator as it isn't appearing when using Messages, writing e-mails etc.

I've looked in Language & input within settings and checked Sample Soft Keyboard, rebooted the emulator with no change.

Using Android SKD 2.3.3

3.7in WVGA (Nexus One)

I'm hoping someone can maybe guess what's going on.

Many thanks


Solution

  • You can use this to get soft keyboard on device:

    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();
    }
    });
    

    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