android-account

Android M 6.0 - SecurityException Trying to remove accounts

六眼飞鱼酱① 提交于 2021-02-07 12:48:47
问题 I have an app that uses Android AccountManager (package name: com.mycompany.accounts), that adds accounts to the device and provides a login screen. I have another app (com.mycomp.actualapp), that uses the first app to add/remove accounts. I can successfully add and remove accounts on Pre Marshmallow devices, using the following permissions in the manifest: <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>

AccountAuthenticatorActivity and fragments

a 夏天 提交于 2020-01-22 10:29:48
问题 Is there are way to use fragments with the AccountAuthenticatorActivity when I'm using the Support Package? AccountAuthenitactorActivity does not subclass the FragmentActivity class and therefore I'm not sure how to use fragments with it when I'm using the Support package. 回答1: No, but the AccountAuthenticatorActivity is just a helper class that does some basic plumbing on the AccountAuthenticatorResponse - you're not required to subclass it. Just borrow (from here, for instance - the code

AccountManager getUserData returning null despite it being set

妖精的绣舞 提交于 2020-01-01 04:12:25
问题 I'm working on an Android app that uses the AccountManager to store accounts & credentials. One problem I've been having is that even though I pass in a bunch of String values to the AccountManager's addAccountExplicitly data bundle. I have checked to make sure that the bundle is not empty and that it contains the values before adding the account. And most of the time this is the case, but every once in a while I get null when I query these values. The null return values are more common after

How do I get my custom account type to show up in the android contacts app?

折月煮酒 提交于 2019-12-30 04:42:07
问题 I've created a custom account type and I can successfully create contacts of that type in the android ContactsContract ContentProvider. But I'm having a lot of trouble figuring out how to get my custom account label and icon to show up when editing the contact in the default contacts app. When editing a custom contact type, the label should be something like " contact", with your app's icon to the right. Instead, editing contacts of my type always show a label of "Phone-only, unsynced contact

How to get rid of java.lang.IllegalStateException while trying to getAuthToken from Account

北慕城南 提交于 2019-12-22 11:09:26
问题 I am trying to get the authToken for an account but getting this error: java.lang.IllegalStateException: calling this from your main thread can lead to deadlock This is how I'm getting the AuthToken: public class MyAccount { private final Account account; private final AccountManager manager; private final Context context; public MyAccount (Context context) { this.context = context; final Account[] accounts = AccountManager.get(context).getAccountsByType("com.myapp"); account = accounts

How to get rid of java.lang.IllegalStateException while trying to getAuthToken from Account

做~自己de王妃 提交于 2019-12-22 11:07:00
问题 I am trying to get the authToken for an account but getting this error: java.lang.IllegalStateException: calling this from your main thread can lead to deadlock This is how I'm getting the AuthToken: public class MyAccount { private final Account account; private final AccountManager manager; private final Context context; public MyAccount (Context context) { this.context = context; final Account[] accounts = AccountManager.get(context).getAccountsByType("com.myapp"); account = accounts

How Can I Get email ids of Yahoo/Microsoft Account

≯℡__Kan透↙ 提交于 2019-12-11 06:39:48
问题 Is it possible to get Yahoo/Microsoft email id/ ids which are configured with PlayStore app in android device. I use com.yahoo.mobile.client.share.sync for Yahoo. But Not Working .May I know what is the correct way to achieve my objective? Here is my code: public String[] allemails() { _accountMgr = AccountManager.get(getActivity()); // Account [] accounts = _accountMgr.getAccounts(); // Account [] accounts = _accountMgr.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE); Account []

Android Account Authenticator edit Email Id Credentials

和自甴很熟 提交于 2019-12-10 12:37:45
问题 When i login with test1@gmail.com in my application.It generate account successfully with my email like this Now i logout and login with different email like test2@gmail.com then it generate account like this I want to know that which is the best way 1) Remove first account and add second account 2) Update first account with second if it is possible to update it. What is Problem I am getting actually? If I remove and again add account using addAccountExplicitly it takes some time for creating

AccountManager does not add custom account in Android N preview

偶尔善良 提交于 2019-12-09 14:54:08
问题 I have implemented a sync adapter in my app which requires an account to be added in the device account settings. I followed the same approach given in the Android docs. It works fine till Marshmallow and I can see my account listed in the device accounts. But in Android N preview, account does not add to the device accounts. AccountManager's addAccountExplicitly() method always returns false. Has anyone faced this problem? 回答1: Not sure if this is the same issue, but there's an issue with

How to add custom app tag in native android contact app?

社会主义新天地 提交于 2019-12-08 15:26:50
问题 I am developing an app and the requirement is to show the app icon in native contact app of android for the contacts who are also using my app i.e. they have installed and registered on my app. I want to show WhatsApp kind label in contacts. Please see these two images for reference I am fetching all the contacts and sending them to server which returns with the list of contacts who are using my app. Only for those contacts I have to show my app icon in contact app. I read lot of resources