Android examples for android.os:Bundle
get Date object from Bundle by Key
import java.util.Date; import android.os.Bundle; public class Main { private static final long INVALID_BUNDLE_MILLISECONDS = Long.MIN_VALUE; public static Date getDate(Bundle bundle, String key) { if (bundle == null) { return null; }//from w w w.jav a2 s . c o m long n = bundle.getLong(key, INVALID_BUNDLE_MILLISECONDS); if (n == INVALID_BUNDLE_MILLISECONDS) { return null; } return new Date(n); } }