Code example for Date

Methods: setTime

0
 
	/** The identifier of this context model object. */ 
	private ACtxIdentifier id;
	 
	/** The last modification time of this context model object. */ 
	private Date lastModified = new Date();
 
 
	/** 
	 * Making class Parcelable 
	 */ 
 
    public int describeContents() { 
        return 0; 
    } 
 
    public void writeToParcel(Parcel out, int flags) {
//      out.writeInt(mData); 
      out.writeParcelable((Parcelable) this.getId(), flags);
      out.writeLong(lastModified.getTime());
       
  } 
 
/*    public static final Parcelable.Creator<ACtxModelObject> CREATOR = new Parcelable.Creator<ACtxModelObject>() { 
        public ACtxModelObject createFromParcel(Parcel in) { 
            return new ACtxModelObject(in); 
        } 
 
        public ACtxModelObject[] newArray(int size) { 
            return new ACtxModelObject[size]; 
        } 
    };*/ 
        
    protected ACtxModelObject(Parcel in) {
//        mData = in.readInt(); 
    	id = in.readParcelable(ACtxIdentifier.class.getClassLoader());
    	lastModified.setTime(in.readLong());
    } 
     
	 
	/** 
	 * Constructs a ACtxModelObject with the specified identifier