title: Extending android Location class and implements parcelable interface
body: <p>I have a Coordinate class that extends the android.location.Location class that implements Parcelable.</p>
  
  <p>Here is my Coordinate class :</p>
  
  <pre class="lang-java prettyprint-override"><code>public class Coordinate extends Location {
  
  
  public Coordinate() {
      super(Keys.DUMMY_PROVIDER);
  }
  
  public Coordinate(Double longitude, Double latitude, Double altitude) {
      super(Keys.DUMMY_PROVIDER);
      this.setLongitude(longitude);
      this.setLatitude(latitude);
      this.setAltitude(altitude);
  }
  
  public Coordinate(Double longitude, Double latitude, Double altitude, Float speed, Long time) {
      super(Keys.DUMMY_PROVIDER);
      this.setLongitude(longitude);
      this.setLatitude(latitude);
      this.setAltitude(altitude);
      this.setSpeed(speed);
      this.setTime(time);
  }
  
  public Coordinate(String raw) {
      super(Keys.DUMMY_PROVIDER);
      String[] coords;
      coords = raw.split("(?&lt;!\\\\),");
      this.setLongitude(Double.parseDouble(coords[0]));
      this.setLatitude(Double.parseDouble(coords[1]));
      this.setAltitude(coords.length&gt;2? Double.parseDouble(coords[2]) : null);
  }
  
  public Coordinate(Location location) {
      super(location);
  }
  
  public static final Parcelable.Creator&lt;Coordinate&gt; CREATOR = new Parcelable.Creator&lt;Coordinate&gt;() {
      public Coordinate createFromParcel(Parcel in) {
          return new Coordinate(in);
      }
  
      public Coordinate[] newArray(int size) {
          return new Coordinate[size];
      }
  };
  
  private Coordinate(Parcel in) {
      super(Keys.DUMMY_PROVIDER);
      in.readParcelable(Location.class.getClassLoader());
  } 
  
  @Override
  public int describeContents() {
      return 0;
  }
  
  @Override
  public void writeToParcel(Parcel dest, int flags) {
      super.writeToParcel(dest, flags);
  }
  }
  </code></pre>
  
  <p>When I run my code I have this error :
  </p>
  
  <pre><code>    12-13 15:21:29.595: E/AndroidRuntime(5499): FATAL EXCEPTION: main
      12-13 15:21:29.595: E/AndroidRuntime(5499): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lavachequiskie.sanbernardo/com.lavachequiskie.sanbernardo.socialnetwork.SocialNetworkActivity}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: dummy-provider
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2107)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2132)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.app.ActivityThread.access$700(ActivityThread.java:140)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.os.Handler.dispatchMessage(Handler.java:99)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.os.Looper.loop(Looper.java:137)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.app.ActivityThread.main(ActivityThread.java:4918)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at java.lang.reflect.Method.invokeNative(Native Method)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at java.lang.reflect.Method.invoke(Method.java:511)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at dalvik.system.NativeStart.main(Native Method)
      12-13 15:21:29.595: E/AndroidRuntime(5499): Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: dummy-provider
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.os.Parcel.readParcelable(Parcel.java:2077)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at com.lavachequiskie.mykml.Coordinate.&lt;init&gt;(Coordinate.java:79)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at com.lavachequiskie.mykml.Coordinate.&lt;init&gt;(Coordinate.java:77)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at com.lavachequiskie.mykml.Coordinate$1.createFromParcel(Coordinate.java:69)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at com.lavachequiskie.mykml.Coordinate$1.createFromParcel(Coordinate.java:1)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.os.Parcel.readParcelable(Parcel.java:2103)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at com.lavachequiskie.mykml.SimplifiedPlacemark.&lt;init&gt;(SimplifiedPlacemark.java:21)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at com.lavachequiskie.mykml.SimplifiedPlacemark.&lt;init&gt;(SimplifiedPlacemark.java:17)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at com.lavachequiskie.mykml.SimplifiedPlacemark$1.createFromParcel(SimplifiedPlacemark.java:89)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at com.lavachequiskie.mykml.SimplifiedPlacemark$1.createFromParcel(SimplifiedPlacemark.java:1)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.os.Parcel.readParcelable(Parcel.java:2103)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.os.Parcel.readValue(Parcel.java:1965)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.os.Parcel.readMapInternal(Parcel.java:2226)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.os.Bundle.unparcel(Bundle.java:223)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.os.Bundle.getString(Bundle.java:1055)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at com.lavachequiskie.sanbernardo.socialnetwork.SocialNetworkActivity.onCreate(SocialNetworkActivity.java:104)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.app.Activity.performCreate(Activity.java:5185)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2071)
      12-13 15:21:29.595: E/AndroidRuntime(5499):     ... 11 more
  </code></pre>
  
  <p>I think my problem come from the constructor <code>private Coordinate(Parcel in)</code> but there is no super(Parcel in) constructor for Location class. I've found some post on this particular problem (<a href="https://stackoverflow.com/questions/15823952/extending-an-android-parcelable-class/15824531#15824531">firt</a>, <a href="https://stackoverflow.com/questions/17725821/how-to-extend-android-class-which-implements-parcelable-interface">second</a>) but finally I don't understand if it's possible to do it and how ?</p>