android - AccountManager throwing UnsupportedOperationException: getAuthTokenLabel -


i calling code below in android app (for authenticating against google app engine, think by-the-by):

accountmanager accountmanager = accountmanager.get(this); accountmanager.getauthtoken(maccount, "ah",null, false, new getauthtokencallback(), null); 

in getauthtokencallback() error thrown:

android.accounts.authenticatorexception: java.lang.unsupportedoperationexception: getauthtokenlabel not supported 

the authentication process stops there.

the odd thing runs on android 5.5.1 device perfectly; unsupportedoperationexception error occurs on 6.0.1 device.

i have runtime permission request get_accounts think need suspect error stems , marshmellow's permissions systems.

@targetapi(23) private boolean havegetaccountpermission() {     log.i(tag, "havegetaccountpermission()");     int haswritecontactspermission = activitycompat.checkselfpermission(this,manifest.permission.get_accounts);     if (haswritecontactspermission != packagemanager.permission_granted) {         activitycompat.requestpermissions(this,new string[] {manifest.permission.get_accounts},                 request_code_ask_permissions);         return false;     } else {         return true;     } } 

any ideas appreciated.

i don't know if helps, i've found creating new account before executing getauthtoken() throws exception.

in case, trying rename account, , found if first execute getauthtoken() old account , then create new account contents, exception no longer thrown.

i'm suspicious may bug in marshmallow.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -