title: How to take a Screenshot from a background-service class using MediaProjection API?
body: <p>After doing a lot of research on this topic, though I found a few answers, I could not understand how the MediaProjection API works.</p>
  <p>I want to take a screenshot of the device from a background Service class. Is it possible to do it. I have one MainActivity.java which starts a serviceIntent to another class which is a service(not an activity). So I want to implement this API in this service class. Please help me</p>