Android Call requires API level 9 (current min is 4

来源:互联网 发布:触摸屏餐饮软件源码 编辑:程序博客网 时间:2024/06/01 08:22

转:http://blog.sina.com.cn/s/blog_77c632410101gtvy.html


【错误描述】

    在用Eclipse开发过程中,当涉及到系统版本不同时,会出现系统提示错误。
【原因分析】
    不详,可能和Run Android Lint有点关系吧。就是创建项目时,我们设置了最低版本API Level,比如是8,因此,Eclipse检查我调用的API后,发现版本号不能向低版本兼容,比如用的控件是Level9 以上才有的,超过了8,所以提示错误。
【解决方案】
   右键点击项目->Android tools ->Clear Link Markers.即可临时解决,但是如果调试用的模拟器是低版本的,则在调试完后还有这个错误。
  如果把manifest文件中的user-sdk的android:minSdkVersion改为报错的那个高版本就没事。比如下面:
 

    

<span style="font-size:18px;"><?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"  package="org.crazyit.progress"  android:versionCode="1"  android:versionName="1.0">    <uses-sdk android:minSdkVersion="9"/><application android:icon="@drawable/icon" android:label="@string/app_name" android:hasCode="true"><activity android:name=".ProgressBarTest"  android:label="@string/app_name"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity></application></manifest> </span>



0 0
原创粉丝点击