Multiple samples showing the best practices in media APIs on Android (audio, video, etc.).
Apache License 2.0
1.27k
stars
741
forks
source link
Caused by: java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION #65
On ScreenCapture (Android 10, SDK 29)
When fire "projectionManager.getMediaProjection()" line then it throw.
java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
How can i fix it?