Call requires API level 14 (current min is 10):

后端 未结 6 1033
感动是毒
感动是毒 2021-01-06 08:53

How can I solve this error ? I do not understand the reason behind this error ?

code

devicePolicyManager.setCameraDisabled(demoDeviceAdmin, false);         


        
相关标签:
6条回答
  • 2021-01-06 09:26

    Make this change in your manifest file:

    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="15" />
    
    0 讨论(0)
  • 2021-01-06 09:28

    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.

    0 讨论(0)
  • 2021-01-06 09:31

    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.

    0 讨论(0)
  • 2021-01-06 09:35

    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.

    0 讨论(0)
  • 2021-01-06 09:40

    You are getting this error because your minimum SDK level, defined in the manifest, is 10. devicePolicyManager. setCameraDisabled(demoDeviceAdmin, false); requires API 14+.

    0 讨论(0)
  • 2021-01-06 09:51

    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.

    0 讨论(0)
提交回复
热议问题