On Android M-Preview, GoogleAccountCredential.setSelectedAccount does not seem to work.
When debugging, I noticed that after calling this method, the selectedAccount and accountName object are still zero.
During debugging, you can see that my accountName variable accountName not empty or null, I call .setSelectedAccountName() , but as you can see in the debug window, the field in GoogleAccountCredential is still null.

I think this could be due to some permissions? On my manifest, I declare the following permissions:
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.USE_CREDENTIALS" /> <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
I know that you get GET_ACCOUNTS permission for free on M (according to https://developer.android.com/preview/features/runtime-permissions.html#normal ), but the other two permissions are "unknown" for M-Preview. So maybe this is so?
source share