Questions tagged [android-account]

Android Account refers to the object public class Account as part of the mobile operating system Android that acts as a Value type that represents an Account in the AccountManager public class. Use this tag for questions related to this public class.

Android Account refers to the object public class Account as part of the mobile operating system Android that acts as a Value type that represents an Account in the AccountManager public class. Use this tag for questions related to this public class.

Documentation: https://developer.android.com/reference/android/accounts/package-summary

106 questions
4
votes
1 answer

App gets continuous low memory crashes only in Android L

I have an App tested on many devices and in various Android Emulator configurations, now I have tried to test the same App on the Android L emulator and get too often out of memory crashes, I have tried to double the AVD memory from 512mb to…
AndreaF
  • 11,975
  • 27
  • 102
  • 168
4
votes
1 answer

How do i launch new Activity from account icon in contacts

I have an Account Authenticator and Sync Adapter which stored the my app contacts separately into my account. That account icon is also getting displayed for those contacts. But am not getting how to go into an activity once i click the account icon…
4
votes
1 answer

Mock up account in ActivityInstrumentationTestCase2

In my Activity, I get accounts in onCreate(): public void MyActivity extends Activity{ ... private Account[] accounts; @Override protected void onCreate(){ accounts = AccountManager.get(this).getAccounts(); } ... } Now, I…
Mellon
  • 37,586
  • 78
  • 186
  • 264
4
votes
1 answer

How to authorize in twitter using android AccountManager?

How to authorize in twitter using android AccountManager? AccountManager am = AccountManager.get(this); Account[] accts = am.getAccountsByType(TWITTER_ACCOUNT_TYPE); if(accts.length > 0) { Account acct = accts[0]; am.getAuthToken(acct,…
pleerock
  • 18,322
  • 16
  • 103
  • 128
3
votes
1 answer

AccountManager throwing UnsupportedOperationException: getAuthTokenLabel

I am calling the code below in an Android app (for authenticating against Google App Engine, think that is by-the-by): AccountManager accountManager = AccountManager.get(this); accountManager.getAuthToken(mAccount, "ah",null, false, new…
Jon
  • 2,280
  • 2
  • 25
  • 33
3
votes
2 answers

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

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…
birdy
  • 9,286
  • 24
  • 107
  • 171
3
votes
1 answer

checking permissions in custom account authenticator

i have a custom authenticator, and i'd like to expose the user / password to other applications. to protect from any random app obtaining the credentials, i'd like to perform something like a permissions check in my custom authenticator's…
Jeffrey Blattman
  • 22,176
  • 9
  • 79
  • 134
2
votes
1 answer

Android: calling AccountManager.getAuthToken from within the service

I'm making a simple REST client in Android: I created a service that is responsible for the REST calls, but it needs the username and password to operate. The username and password is stored in a regular account registry, so what I want to do is to…
Juriy
  • 5,009
  • 8
  • 37
  • 52
2
votes
1 answer

Can one Android app have two different accountTypes?

As I know, an application can make its accountType by adding it in XML file like this: android:accountType="com.android.app.test" I want to know if one app can have two different accountTypes or not.
2
votes
1 answer

Android import import com.google.android.gms.common.AccountPicker error

I am trying to implement an account picker with the following: Intent intent = AccountPicker.newChooseAccountIntent(null, null, new String[]{"com.google"}, false, null, null, null, null); startActivityForResult(intent, 1111); but I get error on…
Evridiki
  • 323
  • 3
  • 16
2
votes
1 answer

android send facebook message from my application

I want to send facebook message (private message) or share a new post from my application using the facebook account logged in from Facebook application or ask the user to log in if there is no Facebook application installed, I have read that…
2
votes
0 answers

How add accounts settings

I already add account without any problem but how i can add custom settings like that : So i need add : custom settings with label or buttons(1) custom action on button MORE (2)
Łukasz Woźniczka
  • 1,625
  • 3
  • 28
  • 51
2
votes
3 answers

Getting the Gmail Id of the User In Android 6.0 marshmallow

I am getting email id by using android.permission.GET_ACCOUNTS permission. try { Account[] accounts = AccountManager.get(this).getAccountsByType("com.google"); for (Account account : accounts) { emailid =…
Mr Robot
  • 1,747
  • 6
  • 35
  • 67
2
votes
0 answers

Android: Get app name from account type

My app need to know the application name from the account type. I am getting the account type from the code : AccountManager am = AccountManager.get(this); Account[] acc = am.getAccounts(); if (acc.length > 0) { for (int accLength = 0; accLength…
Manoj Fegde
  • 4,786
  • 15
  • 50
  • 95
2
votes
0 answers

Showing app icon in contacts by updating contact in android

I wanted to add my app icon in the contacts app as Whatsapp or Skype does. I have gone through some links and managed to add my add in accounts list of settings. Some of the links are here,here and here. But i am not getting how particular contact…