I am developing a project which needs to remotely delete the accounts and sync such as Facebook, Twitter, Dropbox and so forth... Is this possible to be done through programming? Need opinions from you guys...
Thanks.
I am developing a project which needs to remotely delete the accounts and sync such as Facebook, Twitter, Dropbox and so forth... Is this possible to be done through programming? Need opinions from you guys...
Thanks.
AccountManager
はい、とremoveAccount
メソッドを使用して実行できます。
まず、:のインスタンスを取得しAccountManager
ます
AccountManager am = AccountManager.get(this);
次に、デバイス上のすべてのアカウントのリストを取得します。
Account[] accounts = am.getAccounts();
削除するアカウントを選択したら(この例では最初のアカウントを使用します)、次のアカウントを呼び出しremoveAccount
ます。
if (accounts.length > 0) {
Account accountToRemove = accounts[0];
am.removeAccount(accountToRemove, null, null);
}
メソッドの2番目のパラメーターを使用してremoveAccount
、アカウントが削除されたときに呼び出されるコールバックを提供できます(アカウントの削除は非同期操作です)。