【发布时间】:2016-02-03 13:19:17
【问题描述】:
我正在开发 Android MDM,并且在 /src/main/res/xml/ 文件夹下有 app_restrictions.xml 文件。我使用的 MDM 没有显示限制的值,甚至没有显示默认值。已按照此链接中提到的所有步骤设置应用程序限制:https://developer.android.com/training/enterprise/app-restrictions.html 但我得到了 Bundle[EMPTY_PARCEL]。下面是代码
app_restrictions.xml
<?xml version="1.0" encoding="utf-8"?>
<restrictions xmlns:android="http://schemas.android.com/apk/res/android">
<restriction
android:key="MDMEmailKey"
android:title="Email"
android:restrictionType="string"
android:description="@string/email_address_mdm_description"
android:defaultValue="testtesttest@gmail.com" />
<restriction/>
</restrictions>
此外,lint 向我显示了以下错误,尽管我能够通过 lint 选项在 gradle 中抑制它,但只是想知道这是否不是我所面临问题的原因。请让我知道为什么会出现这些错误。
Executing task ':project_name:lintVitalRelease' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
.../src/main/res/xml/app_restrictions.xml:8: Error: Missing required attribute android:key [ValidRestrictions]
<restriction/>
~~~~~~~~~~~~~~
.../src/main/res/xml/app_restrictions.xml:8: Error: Missing required attribute android:restrictionType [ValidRestrictions]
<restriction/>
~~~~~~~~~~~~~~
.../src/main/res/xml/app_restrictions.xml:8: Error: Missing required attribute android:title [ValidRestrictions]
<restriction/>
~~~~~~~~~~~~~~
Explanation for issues of type "ValidRestrictions":
Ensures that an applications restrictions XML file is properly formed
https://developer.android.com/reference/android/content/RestrictionsManager.html
3 errors, 0 warnings
【问题讨论】:
-
您是否在您的应用程序中成功实现了 MDM。你能检查一下吗?您能否在以下方面帮助我.. 非常感谢您的帮助stackoverflow.com/questions/42112688/…
标签: android lint android-lint airwatch