Question

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 from directory libs and unchecked Android Dependencies. Next opened properties of myproject. Went to the projects and by Add button added android-support-v7-appcompat.

But nothing is working. How can I make ActionBarActivity(there is no new variants) and how can I add a theme. I used to add in manifest to activity, tried to add it to the style.xml

enter image description here last

Was it helpful?

Solution

I solved my problem. It was hard to me to find add Library button.

I acted in wrong way. It is below. enter image description here

enter image description here

and here is a correct way. enter image description here

OTHER TIPS

Documentation for the new backwards-compatible ActionBar is at http://developer.android.com/guide/topics/ui/actionbar.html

To install the necessary library, follow the instructions at http://developer.android.com/tools/support-library/setup.html

Follow the instructions closely. You need the appcompat library, but the classes themselves are in android.support.v7.app.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top