尚未解答 電腦與網際網路 / 其他:電腦
AndroidDev- App取得google paly登錄的gmail帳號
匿
匿名
659 次瀏覽
0 個回答
想請問App內如何取得google play登錄的gmail帳號呢?
試過這個方法但無法取得, 在Android 8.0手機上運行,權限也有取得
AccountManager accountManager = AccountManager.get(context);
Account[] accounts = accountManager.getAccounts();
for(Account account : accounts){
Log.i("--Get Account Example--", account.name);
Log.i("--Get Account Example--", account.type);
}
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
--