Stack Overflow archive
1 scoreaccepted

Can't find getUsers() method in class UserManager

score
1
question views
1.7K
license
CC BY-SA 3.0

The method is hidden with @hide. The method also requires the system permission android.Manifest.permission.MANAGE_USERS. This permission cannot be granted to third-party apps.

UserManager#getUsers() documentation:

Returns information for all users on this device, including ones marked for deletion. To retrieve only users that are alive, use getUsers(boolean).

Requires android.Manifest.permission.MANAGE_USERS permission.

Returns: the list of users that exist on the device.


How do I list all users on an Android device?

According to this answer, you could possibly use getUserProfiles.

Originally posted on Stack Overflow. Public user contributions are licensed under Creative Commons Attribution-ShareAlike.