I have a floating button being drawing using android.permission.SYSTEM_ALERT_WINDOW
above all the windows , what am trying to accomplish is once I press on it , I start ProjectionMedia API
here is what am doing :
//passing to it the Main activity
public MyManager(Activity activity) {
this.activity = activity;
// call for the projection manager
mProjectionManager = (MediaProjectionManager) activity.getSystemService(Context.MEDIA_PROJECTION_SERVICE);
}
public void Capture() {
isWorking = true;
mHandler = new Handler();
Intent i = mProjectionManager.createScreenCaptureIntent();
// i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
activity.startActivityForResult(i, REQUEST_CODE);
}
and in MainActivity
I have static MyManager
so I can accesses it from within the service , but once I call Capture
from the Service
the app doesn't do anything , and there is nothing in the logact
, what I'm missing here?