I'm developing a screen recorder app that includes a floating widget. When users press on it, it calls the below code
MediaProjectionManager mediaProjectionManager = (MediaProjectionManager) getSystemService(Context.MEDIA_PROJECTION_SERVICE);
Intent permissionIntent = mediaProjectionManager != null ? mediaProjectionManager.createScreenCaptureIntent() : null;
startActivityForResult(permissionIntent, 101);
after which I start the recording in on activity result method
if (requestCode == 101) {
if (resultCode == RESULT_OK) {
recorder.startScreenRecording(data, resultCode, this);
}
}
and everything works fine but when users press the floating widget when he is outside the app it doesn't pop up the permission dialog to start the recording, it only shows's the permission dialog when the user is in the app.
Any idea or suggestion please ... please...
anything please