I am trying to get the auth token for Google account, for the same I am using below code:
AccountManager acoountManager = AccountManager.get( getContext( ) ); AccountManagerFuture< Bundle > accountManagerFuture = acoountManager.getAuthToken( account, "android", null, (Activity) ctx, null, null ); Bundle authTokenBundle = accountManagerFuture.getResult( );
It should return the auth token if my app have permission to access Google Account token else show a permission request screen.
My problem is, in some of the devices it never returns. Also I observed that it was working once I do factory reset to the same device. I am not able to understand why its not returning before without factory reset, was it missing any system service? Please help!!!