Intent dialogIntent = new Intent(BackgroundService.this, ScreenShotActivity.class); dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(dialogIntent);
I want to ask you if starting the activity ScreenShotActivity.class
, which is the class for the MediaProjection
implementation, from a background-service is the only way to record everything happening on screen.
Source: How to take a Screenshot from a background-service class using MediaProjection API?
Or is it possible to implement everything of the MediaProjection API inside the service itself, without needing an "util" activity?