Android - Keyboard not appearing in floating window

前端 未结 4 1224
轮回少年
轮回少年 2020-12-17 16:37

I\'m writing an application that uses the following code to draw an edittext on the screen over running applications:

WindowManager.LayoutParams params = new         


        
相关标签:
4条回答
  • 2020-12-17 16:38

    My bad.. I realized if I remove the WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE it works fine.. silly mistake

    0 讨论(0)
  • 2020-12-17 16:41

    i resolved this issue by using FLAG_NOT_FOCUSABLE

    0 讨论(0)
  • 2020-12-17 16:47

    Programatically:

    editText.requestFocus();
    

    Or through XML:

    <EditText...>
        <requestFocus />
    </EditText>
    
    0 讨论(0)
  • 2020-12-17 17:04

    Use WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL

    WindowManager.LayoutParams params = new WindowManager.LayoutParams(
                        WindowManager.LayoutParams.WRAP_CONTENT,
                        WindowManager.LayoutParams.WRAP_CONTENT,
                        WindowManager.LayoutParams.TYPE_PHONE,
                        WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
                        PixelFormat.TRANSLUCENT);
    

    For more detail and example follow the link: https://github.com/atifmahmood29/overlays-floating-window-like-facebook-messenger

    0 讨论(0)
提交回复
热议问题