直接将android-support-v7-appcompat.jar包拷贝到项目的libs/下面是不能使用的,具体做法官方文档给出了详细说明:

(开发环境是ADT)

Using Eclipse

Create a library project based on the support library code:

  1. Make sure you have downloaded the Android Support Library using the SDK Manager.
  2. Create a library project and ensure the required JAR files are included in the project's build path:
    1. Select File > Import.
    2. Select Existing Android Code Into Workspace and click Next.
    3. Browse to the SDK installation directory and then to the Support Library folder. For example, if you are adding theappcompat project, browse to <sdk>/extras/android/support/v7/appcompat/.
    4. Click Finish to import the project. For the v7 appcompat project, you should now see a new project titled android-support-v7-appcompat.
    5. In the new library project, expand the libs/ folder, right-click each .jar file and select Build Path > Add to Build Path. For example, when creating the the v7 appcompat project, add both the android-support-v4.jar andandroid-support-v7-appcompat.jar files to the build path.
    6. Right-click the project and select Build Path > Configure Build Path.
    7. In the Order and Export tab, check the .jar files you just added to the build path, so they are available to projects that depend on this library project. For example, the appcompat project requires you to export both the android-support-v4.jar and android-support-v7-appcompat.jar files.
    8. Uncheck Android Dependencies.
    9. Click OK to complete the changes.

You now have a library project for your selected Support Library that you can use with one or more application projects.

Add the library to your application project:

  1. In the Project Explorer, right-click your project and select Properties.
  2. In the Library pane, click Add.
  3. Select the library project and click OK. For example, the appcompat project should be listed as android-support-v7-appcompat.
  4. In the properties window, click OK.

android-support-v7-appcompat的配置使用的更多相关文章

  1. xamarin android 报错 Could not load assembly 'Xamarin.Android.Support.v7.AppCompat

    严重性 代码 说明 项目 文件 行 禁止显示状态 错误 Exception while loading assemblies: System.IO.FileNotFoundException: Cou ...

  2. Android android.support.v7.appcompat.R$styleable

    引入第三方jar或者library时比如自定义控件.突然报如下错误: 07-17 09:22:25.430: E/CrashHandler(14102): Caused by: android.vie ...

  3. Android增加v7 appcompat源码

    1.File ---- Import---- Existing Android Code Into Workspace 2.选择 <sdk>/extras/android/support/ ...

  4. android 使用android.support.v7 添加ActionBar

    当需要在 android 7或更高的版本使用 ActionBar,则可以通过继承ActionBarActivity来实现, 网上有一个开源项目来兼容老版本显示ActionBar的效果:ActionBa ...

  5. 在项目中引用android.support.v7

    在Android开发中,新建的项目可能因为缺少对sopport工程的引用而报错,可以这样解决. 1.项目右键 --> import --> Android --> Existing ...

  6. 配置android.support.v7.widget.Toolbar 搜索框样式

    AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xm ...

  7. android.support.v7.app.AppCompatActivity

    1.Android Studio (api 23) 新建项目的时候 Activity public class MainActivity extends AppCompatActivity 2.系统默 ...

  8. Android Support V7 包中 ActionBar的使用

    以下示例为API<11,因为API>=11时本来就有ActionBar可以使用,所以不猜讨论范围之内 今天Google发布了最新的API 18,包括众多新的性能,正好最近在研究Action ...

  9. java.lang.NoSuchFieldError: No static field abc_ic_ab_back_mtrl_am_alpha of type I in class Landroid/support/v7/appcompat/R$drawable

    出现java.lang.NoSuchFieldError: No static field abc_ic_ab_back_mtrl_am_alpha of type I in class Landro ...

  10. classes could not be found: - android.support.v7.internal.app.WindowDecorActionBar问题的解决方法

    转载至----http://my.oschina.net/u/2425146/blog/546649?fromerr=aDYrFDVx.仅作个人收藏使用,有转载的朋友请连续原作者,谢谢 刚刚进入stu ...

随机推荐

  1. uniq 命令

    uniq 命令 文字 uniq是LINUX命令 用途 报告或删除文件中重复的行. 语法 uniq [ -c | -d | -u ] [ -f Fields ] [ -s Characters ] [ ...

  2. cURL中的超时设置

    访问HTTP方式很多,可以使用curl, socket, file_get_contents() 等方法. 在访问http时,需要考虑超时的问题. CURL访问HTTP: CURL 是常用的访问HTT ...

  3. js函数收藏:获取cookie值

    //先设置一段子cookie var d = new Date(); d.setMonth(d.getMonth() + 1); d = d.toGMTString(); var a = " ...

  4. GPG error [...] NO_PUBKEY [...]

    今天在Linux下遇到这个问题,发现很多资料都是英文的,为了方便出现同样错误的有英语阅读困难的人,整理解决方案如下: sudo apt-key adv --keyserver keyserver.ub ...

  5. js获取每个按键的ASCII值

    通过js绑定键盘按下事件onkeydown获取每个按键的ascII值. js获取每个按键的ascii值 <script language="javascript"> / ...

  6. (二)《Java编程思想》——t h i s 关键字

    this 关键字(注意只能在方法内部使用)可为已调用了其方法的那个对象生成相应的句柄.可象对待其他任何对象句柄一样对待这个句柄. package chapter4; //: Leaf.java // ...

  7. 使用vs中的工具进行架构比较

    使用vs自带的架构比较工具可以对不同库中的结构进行比较,也可以将源中的架构更新到目标架构中.当然这种更新只是架构的更新,数据并不会同步.

  8. 如何启用第三方Chrome插件

    如何安装第三方Chrome插件,先下载扩展名为CRX的文件到本地,提醒一下,不能直接在该网站下打开安装,如果安装失败,可以找到此CRX文件拖入到扩展页安装就可以了! 可是,当我们通过本地安装了第三方C ...

  9. scala学习笔记——特质

    一个类扩展自一个或多个特质,以便使用这些特质提供的服务.特质可能会要求使用它的类支持某个特定的特性.不过和java不同,Scala特质可以给出这些特性的缺省实现. 特质的特性: 类可以实现任意数量的特 ...

  10. Oracle除去换行符的方法

    Oracle除去换行符的方法   很多数据存进数据库后,可能需要将整条数据取出,并用特殊 符号分割,而且整条数据必须是处于一行,如此,如果数据出现 换行的情况,那么读取时就有问题.     这个时候就 ...