How can I solve this error ? I do not understand the reason behind this error ?
code
devicePolicyManager.setCameraDisabled(demoDeviceAdmin, false);
Make this change in your manifest file:
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="15" />
You need to set your target version above API level 14. Right click your project. Select properties. Go to Android. Select version above API level 14.
It is actually a warning from Lint, rather than an error. If you want to keep your current minimum SDK level, you can suppress the warning, and check the SDK level yourself, at run time.
change
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="15" />
to
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="15" />
In your AndroidManifest.xml
.
Because devicePolicyManager.setCameraDisabled(demoDeviceAdmin, false);
requires API 14+.
Note: (by Joachim Isaksson)
though that this will raise the "bar" for running the app from Android 2.3.3 to Android 4.0.
You are getting this error because your minimum SDK level, defined in the manifest, is 10. devicePolicyManager. setCameraDisabled(demoDeviceAdmin, false);
requires API 14+.
setCameraDisabled()
method is introduced in API level 14
. Have a look at official documentation for it here. You should change the API level of your application, if you want to use this method.