Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Android 具有多用户功能:
我想在我的应用程序中识别代码的某些部分,即实际激活的用户。例如,如果激活的用户是第一、第二或访客。
有什么办法可以检查吗?
我刚刚找到了一种方法来识别在系统上创建的第一个主用户(系统用户)。
UserManager um = (UserManager) getContext().getSystemService(Context.USER_SERVICE); um.isSystemUser();
这样我就可以确定用户是否与系统用户不同。