As we know, we can use Android MediaProjection API to capture screen in an Activity, but I want to capture screen in a thread of a Service. But Android Service has no onActivityResult() method that MediaProjection need to do something. It seems that we can only call MediaProjection API like belows:
startActivityForResult(mProjectionManager.createScreenCaptureIntent(), REQUEST_CODE);
Is there a way to use MediaProjection in an Android Service?