允许开始捕获android中我的屏幕中显示的所有内容

问题描述 投票:1回答:1

我可以使用android MediaProjection api和MediaRecorder API捕获屏幕上的所有内容。当我第一次尝试捕获时,它会自动提示许可。我想手动获取Marshmallow的许可。我如何手动取得许可?可能吗?

下面的链接说它提示createScreenCaptureIntent()方法调用的权限。我已经实施了,但需要在开始我的需要之前明确地获得许可。

https://commonsware.com/Android/previews/screenshots-and-screen-recordings

android mediarecorder screen-recording android-mediaprojection
1个回答
0
投票

虽然我们打电话

startActivityForResult(mediaProjectionManager.createScreenCaptureIntent(), REQUEST_CODE_SCREEN_RECORDING);

它转移呼叫

onActivityResult(Intent intent, int requestcode, int resultcode)

如果resultcode没问题,MediaRecordermediaProjecttionManagerVirtualDisplay不为空,那么我们可以说我们获得了屏幕许可,否则mediaPorjectionVirtualDisplay的值将为null

© www.soinside.com 2019 - 2024. All rights reserved.