Android API 17 (introduced in Android 4.2) introduces a new class responsible with managing users in a multi-user environment. As I said before, the multi-user feature is only enabled in tablets.
The official documentation for this class is avaible here.
So what's this all about? This class exposes 7 methods that give you some information about the users currently operating the tablet.
The most straight-forward one is getUserCount() which, pretty obviously, returns the number of user accounts created on the tablet.
The getUserName() function returns the name of the user that is currently logged on. This is useful for generating personalised content (such as displaying the user's name in the corner of your app - or anything you can think of).
The isUserAGoat() function is actually an easter egg and I also made a separate post about it.
No comments:
Post a Comment