Code example for AccountManager

Methods: getUserData

     * @param account The account we're syncing 
     * @return The change high-water-mark 
    private long getServerSyncMarker(Account account) {
        String markerString = mAccountManager.getUserData(account, SYNC_MARKER);
        Log.d(TAG, "getServerSyncMarker(): " + markerString);
        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. 
Connect your IDE to all the code out there  Get Codota for Java