kevalpatel2106 / android-hidden-camera

This library is to take picture using camera without camera preview.
Apache License 2.0
408 stars 155 forks source link

permission denied for window type 2006 #41

Open pavlomelnyk opened 6 years ago

pavlomelnyk commented 6 years ago

Hello. Help needed please.

W/System.err: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$WEx@ab0bdc9 -- permission denied for window type 2006 W/System.err: at android.view.ViewRootImpl.setView(ViewRootImpl.java:829) W/System.err: at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:368) W/System.err: at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93) W/System.err: at com.androidhiddencamera.HiddenCameraService.addPreView(HiddenCameraService.java:125) W/System.err: at com.androidhiddencamera.HiddenCameraService.startCamera(HiddenCameraService.java:82) W/System.err: at com.pins.infinity.services.CaptureImageService.onStartCommand(CaptureImageService.java:98) W/System.err: at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3609) W/System.err: at android.app.ActivityThread.-wrap20(Unknown Source:0) W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1717) W/System.err: at android.os.Handler.dispatchMessage(Handler.java:105) W/System.err: at android.os.Looper.loop(Looper.java:164) W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6710) W/System.err: at java.lang.reflect.Method.invoke(Native Method) W/System.err: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)

Library version 1.3.2

So it only shows up on GL g6 with android 8.1.1. I guess its related to "For Android API level of 8.0.0, you should use WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY instead of LayoutParams.TYPE_TOAST or TYPE_APPLICATION_PANEL or SYSTEM_ALERT." from https://stackoverflow.com/questions/32224452/android-unable-to-add-window-permission-denied-for-this-window-type

pavlomelnyk commented 6 years ago

Ok I see you fixed that at 1.3.4 "/**

InadullaevMakhmudjon commented 5 years ago

Thank you this worked me