How to display the Soft Keyboard from a Service?

后端 未结 3 960
借酒劲吻你
借酒劲吻你 2021-02-14 10:01

Short question: Is it possible (and how) to display the soft-keyboard from a Service?

Long question: I wrote a service which creates a

3条回答
  •  悲哀的现实
    2021-02-14 10:25

    I am facing similar issue. But in my case, problem is due to use of WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE flag while creating WindowManager.LayoutParams for view.

    And for Keyboard visibility

    InputMethodManager inputManager = (InputMethodManager) context.
                    getSystemService(Context.INPUT_METHOD_SERVICE);
            if (inputManager != null) {
                inputManager.toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT);
            } 
    

提交回复
热议问题