Java tutorial
//package com.java2s; //License from project: Apache License import android.accounts.Account; import android.accounts.AccountManager; import android.content.Context; public class Main { /** * Set user data to account * @param context context * @param account account * @param key key * @param value value */ public static void setUserData(Context context, Account account, String key, String value) { if (account == null) throw new IllegalArgumentException("account cannot be null"); AccountManager accountManager = AccountManager.get(context); accountManager.setUserData(account, key, value); } }