read Date from Parcel - Android android.os

Android examples for android.os:Parcel

Description

read Date from Parcel

Demo Code


import android.os.Parcel;
import android.os.Parcelable;
import java.util.Date;

public class Main{
    public static Date readDate(Parcel in) {
        Long ms = in.readLong();//from  ww w.ja  v  a2s . co m
        return ms == null || ms == 0 ? null : new Date(ms);
    }
    public Date readDate() {
        return readDate(in);
    }
}

Related Tutorials