I am trying to record screen video using MediaProjection. I want to capture video in the same activity and not start another activity.
I have gone through a few tutorials. In these tutorials, a call is made to startActivityForResult with createScreenCaptureIntent()
as the first argument, which basically asks for permissions and starts the screen capture. And the resultCode
is passed to getMediaProjection()
startActivityForResult(mProjectionManager.createScreenCaptureIntent(), REQUEST_CODE);
It is necessary that the main activity is captured, so just frame replacement instead of a new activity. I have a floating button in the main activity, listening to stop recording.
So, I wanted to know if it is possible? Or if we can create a similar scenario leading to same events, wihtout creating a new activity of course? Or If this is not possible, how can we stop recording given that we are now in a new activity.
Thank you for your time.