ScreenCapture
ScreenCapture copied to clipboard
不root实现Android屏幕截图
java.lang.RuntimeException: Unable to create service com.branch.www.screencapture.FloatWindowsService: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@92f423f -- permission denied for window type 2003 at android.app.ActivityThread.handleCreateService(ActivityThread.java:3544) at android.app.ActivityThread.access$1300(ActivityThread.java:199) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at...
去掉快门声和截图动作,截图成功也不会有任何响应求楼主分享实现方法
lz,目前发现会有一定频率的空指针异常,暂时我还没找出问题,log如下: Process: com.branch.www.screencapture, PID: 15106 java.lang.NullPointerException: Attempt to invoke virtual method 'android.hardware.display.VirtualDisplay android.media.projection.MediaProjection.createVirtualDisplay(java.lang.String, int, int, int, int, android.view.Surface, android.hardware.display.VirtualDisplay$Callback, android.os.Handler)' on a null object reference at com.branch.www.screencapture.FloatWindowsService.virtualDisplay(FloatWindowsService.java:235) at com.branch.www.screencapture.FloatWindowsService.startVirtual(FloatWindowsService.java:215) at...
我的 Socket 需要接收到命令截图,怎么写? https://gitlink.org.cn/sonichy/FileTrans_Android/tree/master/main%2Fjava%2Fcom%2Fhty%2Ffiletrans%2FSocketManager.java