Window type error

前端 未结 2 1534
清酒与你
清酒与你 2021-01-28 06:17

I\'m creating a audio swipe card reader but I\'m getting an error with windows. I can\'t trace what causing the error in my codes. Can anyone hel me to point what causing the er

2条回答
  •  梦如初夏
    2021-01-28 06:53

    Problem seems to be in onAttachedToWindow(). Change the function as below and give it a try.

    public void onAttachedToWindow() {
            this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
            super.onAttachedToWindow();
    }
    

提交回复
热议问题