I had forgotten to add the class, it is pretty straightforward
/**
* Extension of the date class to implement the Parcelable interface
to allow
* objects of its type to be sent over the network though an Android
service
*
* @author GMelo
* @version 2.09.09
*/
public class ParcebleDate extends Date implements Parcelable
{
/**
* implementation of Android Parcelable.Creator Implements
* Parcelable.Creator<T>
*/
public static final Parcelable.Creator<ParcebleDate> CREATOR = new
Parcelable.Creator<ParcebleDate>()
{
/**
* Reads the Parcel and calls the constructor using as a
parameter
the
* long representation provided in write to parcel
*/
public ParcebleDate createFromParcel( Parcel in )
{
return new ParcebleDate( in.readLong() );
}
public ParcebleDate[] newArray( int arg0 )
{
return new ParcebleDate[arg0];
}
};
/**
* Creates a new date taking as a parameter a long that represents a
number
* of milliseconds since the standard base time and initialises it
with that
* value.
*
* @param dateMill
*/
public ParcebleDate( long dateMill )
{
super( dateMill );
}
public int describeContents()
{
return 0;
}
/**
* Writes the Date to a parcel, instead of serialising it it was
decided to
* take advantage of Dates capability to provide a long
representation of
* itself.
*/
public void writeToParcel( Parcel dest, int flags )
{
dest.writeLong( getTime() );
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---