title: extending serializable geopoint - can't read object back in
body: <p>I need to serialize a list of GeoPoints then read them back in. I searched the web and found out that I can implement my own GeoPoint and implement serializable. It works and I can write the object to a .ser file but when i read it back in i get an invalidclassexception, which goes on to say detail message - illegalaccessexception of the original GeoPoint object. I assume I'm not extending GeoPoint in MyGeoPoint class properly. could someone take a look and tell me where I'm making the error?</p>
  
  <pre><code>import com.google.android.maps.GeoPoint;
  import java.io.IOException;
  import java.io.ObjectInputStream;
  import java.io.ObjectOutputStream;
  import java.io.Serializable;
  
  public class MyGeoPoint extends GeoPoint implements Serializable {
  static final long serialVersionUID = -3010695769693014199L;
  
  
  public MyGeoPoint(int latitude, int longitude){
      super(latitude, longitude);
  }
  public MyGeoPoint(){
      this(0,0);
  }
  private void writeObject(ObjectOutputStream s) throws IOException{
      s.defaultWriteObject();
  }
  private void readObject(ObjectInputStream s)
          throws java.io.IOException, java.lang.ClassNotFoundException{
      s.defaultReadObject();
  }
  }
  </code></pre>
  
  <p>and then it gets used like</p>
  
  <pre><code>File filex = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator +"floodData.ser");
      MyGeoPoint aPoint = new MyGeoPoint();
      MyGeoPoint readPoint = null;
      //write
      try{
      FileOutputStream f = new FileOutputStream(filex);
      ObjectOutputStream s = new ObjectOutputStream(f);
      s.writeObject(aPoint);
      s.close();
      } catch (IOException e) {
          e.printStackTrace();
      }
  
      //read
      try {
      FileInputStream ff = new FileInputStream(filex);
      ObjectInputStream ss = new ObjectInputStream(ff);
      readPoint = (MyGeoPoint)ss.readObject();
      ss.close();
      } catch (ClassNotFoundException e) {
          e.printStackTrace();
      } 
      catch (Exception e) {
          e.printStackTrace();
      } 
      //end serialisationtest 
  </code></pre>