title: Context has changed, operation is not possible
body: <p>My app is using two separate <code>Process</code>. I am having all the <code>Services</code> in one <code>Process</code> and all other component in another <code>Process</code>. When I am trying to get the lastKnownLocation from the <code>LocationManger</code> when an <code>Intent</code> with action is received in <code>public int onStartCommand(Intent intent, int flags, int startId)</code> from an <code>Activity</code>, I am getting the <code>Location</code> null , when I see the <code>LocationManager</code> object in the debugger its showing that <code>Context has changed, operation is not possible</code>. Thanks for help<a href="https://i.stack.imgur.com/Vvpqr.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Vvpqr.png" alt="enter image description here"></a>.
  Here is the snippet of code-</p>
  
  <pre><code>@Override
      public int onStartCommand(Intent intent, int flags, int startId) {
          String action = intent.getAction();
          if (action != null) {
              if (action.equalsIgnoreCase(Synchronize.ACTION_UPDATE_LOCATION)) {
                  Location location = getLastKnownLocation();
                  if (location != null) {
                      new Synchronize(getApplicationContext()).
                              updateLocation(prefs.getInt(Utils.PROPERTY_USER_ID, 0),
                                      location.getLatitude(), location.getLongitude(),
                                      Utils.formatDateMilliSecondToUTC(location.getTime()));
                  }
              } else if (action.equalsIgnoreCase(Synchronize.ACTION_SYNC_CONTACTS)) {
                  new Synchronize(getApplicationContext()).syncContacts();
              } else if (action.equalsIgnoreCase(Synchronize.ACTION_SYNC_EVENTS)) {
                  new Synchronize(getApplicationContext()).syncEvents();
              } else if (action.equalsIgnoreCase(Synchronize.ACTION_SYNC_OFFERS)) {
                  new Synchronize(getApplicationContext()).syncOffers();
              } else if (action.equalsIgnoreCase(Synchronize.ACTION_SYNC_DISCOVERS)) {
                  new Synchronize(getApplicationContext()).syncDiscoverEvents();
              }
          }
          return START_STICKY;
      }
  
      private Location getLastKnownLocation() {
          LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
          if (Build.VERSION.SDK_INT &gt; Build.VERSION_CODES.LOLLIPOP_MR1) {
              if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp;
                      checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
                  return locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
              }
          } else {
              return locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
          }
          return null;
      }
  </code></pre>