picview/src/com/google/android/apps/picview/data/AccountsDatabase.java
public synchronized long put(int position, int accountType, String accountId,
      String accountName) {
    // Determine last position + 1.
    if (position == -1) {
      position = queryAll().getHighestPosAndClose() + 1;
    }
    Log.i(TAG, "Putting account into database as position: " + position);

    // If the account name wasn't given, we set the ID as the name. We will
    // later sort accounts in the UI by name, so it make sense that every entry
    // has valid name.
    if (accountName == null || accountName.isEmpty()) {
      Log.i(TAG, "Account name set to account ID as non was given.");
      accountName = accountId;
    }

    ContentValues values = new ContentValues();
    values.put(COLUMN_POSITION, position);
    values.put(COLUMN_TYPE, accountType);
    values.put(COLUMN_ACCOUNT_ID, accountId);
    values.put(COLUMN_ACCOUNT_NAME, accountName);
    return db.replace(TABLE_NAME, COLUMN_ACCOUNT_NAME, values);
  }
/**
   * Puts an account into the database or replaces the one with the same
   * <code>position</code>.
   * 
   * @param position
   *          The position in of the account in the list. If <code>-1</code> is
   *          given, the position will be <code>currentMaxPosition + 1</code>.
   * @param accountType
   *          The account type.
   * @param accountId
   *          The ID of the account.
   * @param accountName
   *          The name of the account to be displayed.
   * @return The row.
   */
Puts an account into the database or replaces the one with the same
position.

@param position
The position in of the account in the list. If -1 is
given, the position will be currentMaxPosition + 1.
@param accountType
The account type.
@param accountId
The ID of the account.
@param accountName
The name of the account to be displayed.
@return The row.
Puts an account into the database or replaces the one with the same position . @param position The position in of the account in the list . If - 1 is given the position will be currentMaxPosition + 1 . @param accountType The account type . @param accountId The ID of the account . @param accountName The name of the account to be displayed . @return The row .
public synchronized long put(int position, int accountType, String accountId,
      String accountName) {
    if (position == -1) {
      position = queryAll().getHighestPosAndClose() + 1;
    }
    Log.i(TAG, "Putting account into database as position: " + position);
    if (accountName == null || accountName.isEmpty()) {
      Log.i(TAG, "Account name set to account ID as non was given.");
      accountName = accountId;
    }
    ContentValues values = new ContentValues();
    values.put(COLUMN_POSITION, position);
    values.put(COLUMN_TYPE, accountType);
    values.put(COLUMN_ACCOUNT_ID, accountId);
    values.put(COLUMN_ACCOUNT_NAME, accountName);
    return db.replace(TABLE_NAME, COLUMN_ACCOUNT_NAME, values);
  }
public synchronized long put ( int position , int accountType , String accountId , String accountName ) { if ( position == - 1 ) { position = queryAll ( ) . getHighestPosAndClose ( ) + 1 ; } Log . i ( TAG , "Putting account into database as position: " + position ) ; if ( accountName == null || accountName . isEmpty ( ) ) { Log . i ( TAG , "Account name set to account ID as non was given." ) ; accountName = accountId ; } ContentValues values = new ContentValues ( ) ; values . put ( COLUMN_POSITION , position ) ; values . put ( COLUMN_TYPE , accountType ) ; values . put ( COLUMN_ACCOUNT_ID , accountId ) ; values . put ( COLUMN_ACCOUNT_NAME , accountName ) ; return db . replace ( TABLE_NAME , COLUMN_ACCOUNT_NAME , values ) ; }
Puts an account into the database or replaces the one with the same
 <code>position</code>.
Puts an account into the database or replaces the one with the same <code > position< / code > .
// Determine last position + 1. // If the account name wasn't given, we set the ID as the name. We will // later sort accounts in the UI by name, so it make sense that every entry // has valid name.