-1

I have the next method:

protected synchronized void buildGoogleApiClient() {

    mGoogleApiClient = new GoogleApiClient.Builder(context)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(LocationServices.API).build();
}

The method should run in service with isolatedProcess="true", the problem is the context object becomes null in the isolated Process, how to handle it?

Khalil
  • 24
  • 1
  • 4

1 Answers1

0

try to get context with getApplicationContext(). and the context you are using may be getting destroyed thats why you are getting null.

Nishant Pardamwar
  • 1,450
  • 12
  • 16