0

Is there any way to determine if there are other users installed on the device or if the device is being used a single user tablet?

Along those lines is it possible to get the name, id, or Google account of the current user?

4

2 回答 2

0

要回答您的第二个问题,此代码将返回当前用户的所有 Google 帐户:

    AccountManager manager = AccountManager.get(context);
    Account[] accounts = manager.getAccountsByType("com.google");

您还需要在清单中获得此权限:

    <uses-permission android:name="android.permission.GET_ACCOUNTS" /
于 2013-02-05T19:21:15.750 回答
0

有关帐户信息,请参阅AccountManager课程。这应该向您显示设备上的帐户并允许您确定其他用户等。

有关详细信息,请查看以下帖子(以及其他类似的帖子......):

如何在安卓手机上找回登录的谷歌账户?

于 2013-02-05T19:21:20.570 回答