[英]How to check whether Android device supports OTG features programatically
[英]Programatically Check whether my android device has activated work profile or not?
我想阻止我的 Android 应用程序在我的个人资料中运行,当我的工作资料被激活时,有没有办法从我的 Android 应用程序中检查,Android 系统是否激活了工作资料? 谢谢
请找到以下代码:
final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
if(um.isManagedProfile()){
Log.d(TAG,"It is work profile " );
}else{
Log.d(TAG,"It is a personal profile" );
}
看看https://developer.android.com/reference/android/os/UserManager#isManagedProfile()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.