如何删除用户帐户(的Gmail,Facebook的)信息,并保存在Android手机方案盟友的数据? [英] How to delete the User accounts (Gmail, Facebook) Info and data saved in Android phone programmatic-ally?

查看:287
本文介绍了如何删除用户帐户(的Gmail,Facebook的)信息,并保存在Android手机方案盟友的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个需要删除/擦除的Facebook,微博,Gmail的类似登录信息的用户帐户和数据,Android设备的项目。需要你的意见......

I am developing a project which needs to delete/erase the user accounts like Login info and data of Facebook, Twitter, Gmail in Android Device. Need opinions from you...

推荐答案

你能做到这样,我想在Gmail上的工作对我来说它很清楚gmail的APSS和日志等中没有历史 你只要登录了,但不知道你是什么意思删除?

you can do this way,i tried on gmail its working for me and its become clear the gmail apss and no history of log in etc you will just log out but dont know what do you mean by delete?

AccountManager am = AccountManager.get(this);
Account[] accounts = am.getAccounts();
if (accounts.length > 0) {
    Account accountToRemove = accounts[0];
    am.removeAccount(accountToRemove, null, null);
}

添加以下权限以及

Add the following permission as well

 <uses-permission android:name="android.permission.ACCOUNT_MANAGER"/>
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS"/>
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>

这篇关于如何删除用户帐户(的Gmail,Facebook的)信息,并保存在Android手机方案盟友的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆