title: Request Location Permissions from a service Android M
body: <p>I am using a service that on boot starts up and begins to check for location updates. Once i deny location access on permission popup now thanks to Android M my service crashes once the phone boots up.</p>
  
  <p>Since i have no activity in this case the call to <code>requestPermissions()</code> returns a <code>ClassCastException</code> as my service <code>Context</code> cannot be cast to an activity. </p>
  
  <p>My method call:</p>
  
  <pre><code>ActivityCompat.requestPermissions((Activity) mContext, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, REQUEST_COARSE_LOCATION);
  </code></pre>
  
  <p>Is there any solution so far to this OR do I have to revoke the service rights to NOT run in such a state.</p>