0

I created my own keyboard on my Android Project, and it works fine; here is a little snippet of code:

mKeyboard = new Keyboard(this, R.layout .keyboard);
mKeyboardView = (CustomKeyboardView) findViewById(R.id.KeyboardArea);
mKeyboardView.setKeyboard(mKeyboard);

I make it appear whenever the user touches the editText of my Activity. My problem is that the standard keyboard is still working if I press the central botton of my emulator keyboard...furthermore despite I put this:

android:windowSoftInputMode="adjustResize"

in my AndroidManifest file but it only works for the standard keyboard...so, is it possibile to completely substitute the system's soft keyboard with my customized one?

Dharma Dude
  • 569
  • 3
  • 5
  • 15

2 Answers2

1

Try: getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);

See also: How to stop Soft keyboard showing automatically when focus is changed (OnStart event)

Community
  • 1
  • 1
Noah
  • 1,916
  • 1
  • 14
  • 29
  • how about... this: http://stackoverflow.com/questions/1109022/how-to-close-hide-the-android-soft-keyboard – Noah Aug 28 '11 at 15:06
0

You just do this....

int lastwidth;

@Override
    public void onInitializeInterface() {

        if(mKeyboard!=null){
            int diswidth = getMaxWidth();
            if(lastwidth==diswidth){
                return;
            }
            lastwidth=diswidth;
        }

        alphakeyb = new Keyboard(this, R.layout.alphakey);

    }

    @Override
    public View onCreateInputView() {

        // inflatin keyboardview from xml file
        keybview = (KeyboardView) getLayoutInflater().inflate(R.layout.customkeybview,null);

        // setting listner on keyboardview
        keybview.setOnKeyboardActionListener(this);
        // setting keyboard to keyboardview
        keybview.setKeyboard(alphakeyb);

        return keybview;

    }

You can also refer the android softkeyboard example in the API Demos

Lalit Poptani
  • 65,659
  • 21
  • 155
  • 238
Maverick
  • 2,963
  • 5
  • 21
  • 30