title: android.os.BadParcelableException: ClassNotFoundException when unmarshalling : FusedLocationProvider API
body: <p>I am trying to create a background location tracker using <code>Google FusedLocationProvider API</code>. I have used Pending Intent for the same and created an <code>IntentService</code> class. I have also added a notification to notify user about the running location tracker. However, when I run the application, I can't see any notification, instead I am getting following warning in logcat:</p>
  
  <pre><code>W/Intent: Failure filling in extras
                                         android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.google.android.gms.location.LocationResult
                                             at android.os.Parcel.readParcelable(Parcel.java:2077)
                                             at android.os.Parcel.readValue(Parcel.java:1965)
                                             at android.os.Parcel.readMapInternal(Parcel.java:2226)
                                             at android.os.Bundle.unparcel(Bundle.java:223)
                                             at android.os.Bundle.putAll(Bundle.java:302)
                                             at android.content.Intent.fillIn(Intent.java:6367)
                                             at com.android.server.am.PendingIntentRecord.sendInner(PendingIntentRecord.java:210)
                                             at com.android.server.am.PendingIntentRecord.send(PendingIntentRecord.java:192)
                                             at android.content.IIntentSender$Stub.onTransact(IIntentSender.java:64)
                                             at android.os.Binder.execTransact(Binder.java:351)
                                             at dalvik.system.NativeStart.run(Native Method)
  </code></pre>
  
  <p>I am even not able to identify if my <code>PendingIntent</code> is working fine or not.</p>
  
  <p><strong>Here is my <code>IntentService</code> Class:</strong></p>
  
  <pre><code>public class LocationHandlerService extends IntentService {
  
      Location mLocation;
      NotificationManager notificationManager;
  
      public LocationHandlerService() {
          super("Services.LocationHandlerService");
      }
  
  
    /*  @Override
      public void setIntentRedelivery(boolean enabled) {
          super.setIntentRedelivery(true);
      }
  */
      @Override
      public int onStartCommand(Intent intent, int flags, int startId) {
  
          return START_NOT_STICKY;
      }
  
  
      @Override
      protected void onHandleIntent(Intent intent) {
  
          ResultReceiver locationReceiver = intent.getParcelableExtra(Constants.RECEIVER);
  
          if (LocationResult.hasResult(intent)) {
  
              LocationResult locationResult = LocationResult.extractResult(intent);
              mLocation = locationResult.getLastLocation();
              setupNotification();
              Bundle bundle = new Bundle();
              bundle.putParcelable(Constants.BUNDLE, mLocation);
              locationReceiver.send(Constants.RESULT_DATA_KEY, bundle);
  
          }
      }
  
      //Setup Notification
      private void setupNotification() {
  
          final Intent notificationIntent = new Intent(getApplicationContext(), MainActivity.class);
          notificationIntent.addCategory("android.intent.category.LAUNCHER");
  
          final PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
          notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
          NotificationCompat.Builder notification = new NotificationCompat.Builder(getApplicationContext())
                  .setSmallIcon(R.drawable.location_start_notification)
                  .setOngoing(true)
                  .setPriority(Notification.PRIORITY_DEFAULT)
                  .setContentTitle(getResources().getString(R.string.location_notification))
                  .setContentText("Lat: " + mLocation.getLatitude() + ", Long: " + mLocation.getLongitude())
                  .setContentIntent(pendingIntent);
  
          notificationManager.notify(1, notification.build());
  
      }
  
      @Override
      public void onDestroy() {
  
          stopForeground(true);
  
      }
  
      // Creating constants to report the results of the Location Update process
      public final class Constants {
  
          public static final String PACKAGE_NAME = "com.svtech.thirdeye.thirdeye";
          public static final String RECEIVER = PACKAGE_NAME + ".RECEIVER";
          public static final int RESULT_DATA_KEY = 9;
          public static final String BUNDLE = PACKAGE_NAME + ".BUNDLE";
      }
  
  }
  </code></pre>
  
  <p>Can anyone please help????</p>