解决办法:

第一种方法:修改AndroidManifest.xml中的minSdkVersion=11
 
第二种方法:
1.导入android-support-v7-appcompat项目,并将其作为原项目的lib库项目
2.用getSupportActionBar();代替getActionBar();
         ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);//设置返回键
 
 
第一种办法虽然简单快速,但是不能在3.0以下的版本手机上做测试。

【转】调用getActionBar()报Call requires API level 11 (current min is 8): android.app.Activity#getActionBar的更多相关文章

  1. Call requires API level 11 (current min is 8)报错

    新建一个Android Application Project,其中MainActivity.java中报错如下 Call requires API level 11(current min is 8 ...

  2. 【Android】Field requires API level 4 (current min is 1): android.os.Build.VERSION#SDK_INT

    刚遇到了这个问题: Field requires API level 4 (current min is 1): android.os.Build.VERSION#SDK_INT 解决方法: 修改 A ...

  3. Android Call requires API level 11 (current min is 8)的解决方案

    [错误描述] 在用Eclipse开发过程中,为了兼容Android2.2和4.0以上版本,我在使用Notification类时做了2个版本的代码,代码根据系统版本不同执行相应模块,结果,等我输完代码, ...

  4. Type Call requires API level 11 (current min is 8)解决办法

    解决办法: 1:project-->clean.. 2:右键工程-->Android Tools-->clean lint markers 3:修改AndroidManifest.x ...

  5. Call requires API level 7 (current min is 1):(问题解决)

    在一个导入的项目里修改加入webView的时候设置缩放属性的设置报错: Call requires API level 7 (current min is 1): android.webkit.Web ...

  6. Call requires API level 21(Current min is 16)

    Call requires API level 21(Current min is 16) Android开发中,遇到类似这种问题,如何处理? 一种办法是提升sdk最低版本到21,在Android s ...

  7. SimpleDateFormat 出现错误 Call requires API level 24 (current min is 15)

    这个故事是这样的 今天写打卡时间的时候需要获取一下当前时间,然后我就写了一个这个 SimpleDateFormat sDF =   new SimpleDateFormat("yyyy-MM ...

  8. all requires API level 3 (current min is 1)问题的解决

    几次出现了all requires API level 3 (current min is 1)的错误,后来发现解决的方法是右键单击项目文件夹,选择Android Tools->Clear Li ...

  9. Call requires API level 3 (current min is 1)

    结果出现“Call requires API level 3 (current min is 1): 解决方法: 在工程上点击右键 -> Android Tools -> Clear Li ...

随机推荐

  1. HDU 2722 Here We Go(relians) Again (spfa)

    Here We Go(relians) Again Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/ ...

  2. linex下部署发布web项目

    准备工作:通过Xmanager远程连接linux系统,下载对应的jdk和tomcat. 1.通过Xmanager远程连接linux系统,下载地址请自己网上搜索吧. 2.下载jdk (这里为jdk-7u ...

  3. iOStextView的代理方法展示

    UITextView的代理方法 textViewShouldBeginEditing: and textViewDidBeginEditing: - (BOOL)textViewShouldBegin ...

  4. Windows 路径问题

    Windows路径是我们经常使用的东西,它看似简单,实际上隐含许多细节,这些都是在平常的使用过程中注意不到的.下面让我们来看看各种各样的Windows路径.     提起路径,我们都会想到" ...

  5. JS获取网页中HTML元素的几种方法分析

    getElementById getElementsByName getElementsByTagName 大概介绍 getElementById ,getElementsByName ,getEle ...

  6. vmware 命令行启动虚拟机

    在redhat enterprise 5.3安装了vmware workstation,如何用vmware 命令行启动指定虚拟机?/usr/bin/vmware[root@node0 ~]# /usr ...

  7. JavaScript在智能手机上的应用-判断是否为移动浏览器

    -------------------- <script type="text/javascript">            var userAgent = navi ...

  8. @Value 注解获取properties值

    转自:使用Spring 3的@value简化配置文件的读取 Spring 3支持@value注解的方式获取properties文件中的配置值,大简化了读取配置文件的代码. 1.在application ...

  9. CSS3秘笈:第三章

    1.标签选择器:控制整体. 使用标签选择器,只需要输入标签的名称即可. 2.类选择器:精确控制. 假如你要指定一些相同的元素拥有不同的样式,可以给元素添加不同的类名,然后用类选择器来应用对应的样式. ...

  10. Centos7下安装numpy+matplotlib+scipy

    摘自:http://litchiware.github.io/centos/2015/07/05/centos7%E4%B8%8B%E5%AE%89%E8%A3%85numpy+matplotlib+ ...