Window type error

前端 未结 2 1425
清酒与你
清酒与你 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:45

    your targetSdk must be less than 14.

    try setting it to 13

    Check this Answer. And it works for me.

    0 讨论(0)
  • 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();
    }
    
    0 讨论(0)
提交回复
热议问题