如何以编程方式在托管配置文件(Android 5.0)中启用非市场应用程序 [英] How to enable Non market application in Managed Profile (Android 5.0) programmatically
问题描述
您好,我正在检查Android 5.0示例,其中有示例BasicManagedProfile。使用它,我已经成功创建了托管配置文件。但是它只管理Market应用程序(从Google Play下载)作为托管应用程序。
但我尝试使用自定义说出的HelloWOrld应用程序在市场上不可用。它给了我错误 java.lang.IllegalArgumentException:只能以这种方式启用系统应用程序。
Hello I was checking Android 5.0 samples there was sample BasicManagedProfile. Using that I have created managed profile successfully. But it was managing only Market applications (Downloaded from Google Play) as managed application. But I tried with custom say it HelloWOrld application that is not available on Market. It gave me the error " java.lang.IllegalArgumentException: Only system apps can be enabled this way."
devicePolicyManager.enableSystemApp(
BasicDeviceAdminReceiver.getComponentName(activity), packageName);
我用来启用应用程序的代码。
是否有任何方法或API可以在托管配置文件中启用自定义应用程序。
code that i was using to enable application. Is there any way or API to enable Custom application in Managed Profile.
推荐答案
搜索了很多天后,我发现当前google还没有提供任何API /方法来在托管配置文件中启用非市场应用程序。
After searching for many days I found that currently google has not provided any API/ methods to enable non-market application in managed profile.
这篇关于如何以编程方式在托管配置文件(Android 5.0)中启用非市场应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!