private void removeAccount(final Account account) {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
sharedPreferences.edit().remove("queueName").apply();
ContentResolver.setIsSyncable(account, WEBINSTALL_SYNC_AUTHORITY, 0);
ContentResolver.setSyncAutomatically(account, MyAccountActivity.WEBINSTALL_SYNC_AUTHORITY, false);
if(Build.VERSION.SDK_INT>=8){
ContentResolver.removePeriodicSync(account, MyAccountActivity.WEBINSTALL_SYNC_AUTHORITY, new Bundle());
}
mAccountManager.removeAccount(account, new AccountManagerCallback<Boolean>() {
@Override
public void run(AccountManagerFuture<Boolean> future) {
addAccount();
finish();
}
}, null);
}
MyAccountActivity.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:aptoide-client
作者:
评论列表
文章目录