If I popup input method with togglesoftinput,my view's onCreateInputConnection was not called, and i can not com开发者_JAVA百科municate 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 ?
hurray,I do it.
yeah,,,like this:
main_view.setFocusable(true);
main_view.requestFocus();
main_view.setFocusableInTouchMode(true);
main_view.requestFocusFromTouch();
精彩评论