Code example for AccountManager

Methods: getUserData

0
     *            the account we're syncing 
     * @return the change high-water-mark 
     */ 
    private long getServerSyncMarker(Account account)
    { 
        String markerString = mAccountManager.getUserData(account, SYNC_MARKER_KEY);
        if (!TextUtils.isEmpty(markerString))
        { 
            return Long.parseLong(markerString);
        } 
        return 0; 
    } 
 
    /** 
     * Save off the high-water-mark we receive back from the server. 
     *  
     * @param account 
     *            The account we're syncing 
     * @param marker 
     *            The high-water-mark we want to save. 
     */