Code example for Time

Methods: set, toString

0
		SharedPreferences settings = mContext.getSharedPreferences(
				"cn.edu.tsinghua.hpc.tmms", 0); 
		long millis = settings.getLong(LAST_SYNC_TIME, 0);
		Time time = null;
		if (millis != 0) {
			time = new Time();
			time.set(millis);
		} 
		Log.d(TAG, "getLastSyncTime: " + time != null ? time.toString()
				: "none"); 
		return time;
	} 
 
	public static void setLastSyncStatus(boolean status) {
		Log.d(TAG, "setLastSyncStatus: " + status);
		SharedPreferences settings = mContext.getSharedPreferences(
				"cn.edu.tsinghua.hpc.tmms", 0); 
		SharedPreferences.Editor editor = settings.edit();
		editor.putBoolean(LAST_SYNC_STATUS, status);
		editor.commit();
	}