You can update existing accounts using methods provided by the AccountsManager
When you call the updateAccount
method of AccountsManager
, you completely replace the existing account object referenced by the method. Be sure to retrieve the account you want to update and make changes to it before calling updateAccount()
To update an account, perform the following steps:
- Use the AccountsManagerFactory to access a singleton instance of the platform implementation of the AccountsManager interface.
- Retrieve the existing version of the account object you want to change and make the properties changes.
- Use one of the following methods to update the account:
Parent topic: Accounts framework
- updateAccount(Account) – Updates an existing Account object in persistent store (completely replaces existing account object).
- newAccount(java.lang.String id) – Use this method to make changes to an account object and then change the UID to match that of the existing account.