tags:

views:

28

answers:

1

If I popup input method with togglesoftinput,my view's onCreateInputConnection was not called, and i can not communicate with input method.

And then i try to attach the input method to my view:

public boolean showSoftInput(View view, int flags,ResultReceiver resultReceiver) {
   checkFocus();
   synchronized (mH) {
      if (mServedView != view && (mServedView == null || !mServedView.checkInputConnectionProxy(view))) {
         return false;
      }
   }
...

but it returns false

How can I force onCreateInputConnection to be called?

or

How can I make mServedView == view ?

A: 

hurray,I do it.

yeah,,,like this:

main_view.setFocusable(true);
main_view.requestFocus();
main_view.setFocusableInTouchMode(true);
main_view.requestFocusFromTouch();
sylar_u