How to add support libraries?

前端 未结 3 625
时光取名叫无心
时光取名叫无心 2020-12-10 08:42

I added android-support-v7-appcompat. Next I clicked on each file in directory \\libs. Then I clicked android-support-v7-appcompat and opened properties. Next checked files

3条回答
  •  鱼传尺愫
    2020-12-10 09:11

    But nothing is working. How can I make ActionBarActivity(there is no new variants)

    This document is quite dense if English is not your first language. So these are the key steps from the "Adding libraries with resources" section of http://developer.android.com/tools/support-library/setup.html

    1) Add support library WITH RESOURCES (file ...import ... android ... existing android code into workspace)

    2) Check it is defined as a library project (properties .. android ... isLibrary checked), then REFERENCE it in your application project (properties .. android ... reference ... add)

    3) Then in the library project - right clicked on each of the jar files in libs and do (build path ... add to build path)

    4) Then FOR THE LIBRARY PROJECT do right click ...( build path ... configure build path ... order and export ...) check both of these libraries and unchecked android dependencies

    At this point, your android-support-v7-appcompat library project should contain no errors. You should also be able to use ActionBarActivity in your project and things like android:theme="@style/Theme.AppCompat.Light" in your manifest.

    I used to add in manifest to activity, tried to add it to the style.xml

    You should not now need to add style.xml to your project - it will be picked up from the referenced library project. I suggest you confirm all this is working before you proceed to http://developer.android.com/guide/topics/ui/actionbar.html

提交回复
热议问题