How to mimic Google Keyboard's spacebar long-press functionality for switching keyboards?

非 Y 不嫁゛ 提交于 2019-12-02 17:41:35

问题


Google Keyboard lets you long-press the spacebar to switch keyboards in Android. I haven't turned anything up with a Google search but I'm certain there's a way to do this programmatically.

How can I bring up the input method picker?


回答1:


They use showInputMethodPicker():

private void onSpaceBarLongPress() {
    InputMethodManager imm = (InputMethodManager)
        getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.showInputMethodPicker();
}


来源:https://stackoverflow.com/questions/35376419/how-to-mimic-google-keyboards-spacebar-long-press-functionality-for-switching-k

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!