我是 android 编程新手,我需要一些建议。如果激活了所谓的“生产力模块”,有谁知道如何在 java 中查找,我使用的是联想 TAB P 11 Pro 设备。例如,对于三星 Dex,您可以查看文章https://developer.samsung.com/samsung-dex/modify-optimizing.html
Configuration config = getResources().getConfiguration();
try {
Class configClass = config.getClass();
if (configClass.getField("SEM_DESKTOP_MODE_ENABLED").getInt(configClass)
== configClass.getField("semDesktopModeEnabled").getInt(config)) {
// Samsung DeX mode enabled
}
} catch (NoSuchFieldException | IllegalAccessException | IllegalArgumentException e)
{
// Device does not support Samsung DeX
}