title: Android Show Dialog From a Service on error
body: <p>I have a <code>Service</code> that implements <code>GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener, LocationListener</code>.</p>
  
  <p>So, when I create the <code>Service</code> I check to see if <code>Google Play Services</code> is available, or at the correct version:</p>
  
  <pre><code>private boolean servicesConnected() {
  
    // Check that Google Play services is available
    int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
  
    // If Google Play services is available
    if (ConnectionResult.SUCCESS == resultCode) {
        return true;
    } else {
      // Get the error code
        GooglePlayServicesUtil
            .getErrorDialog(resultCode, this, 0).show();// This won't work in a service
    }
  
  }//end
  </code></pre>
  
  <p>So, if I return an error code, how can I respond to it (showing the user a <code>Dialog</code> with options) since I am inside of a <code>Service</code>? What is the best practices in this circumstance?</p>