I have used Appcompat for Actionbar to get actionbar in Android 2.1 devices. I included appcompat library. but it shows Theme.AppCompat.Light not found. please provide suggestions.!
As explained in this thread, you can't just add the jar files, you need to add the full project as a Library dependency. You can find the instructions here.
Try using below Step:
1) File->Import (android-sdk-xxx\extras\android\support\v7). Choose appcompat
2) Project-> properties->Android. In the section library Add and choose appCompat
Related
I want to implement action bar in my android application. I have searched for that and I found out the I need to add some libraries in order to able to use action bar for android 2.X. I started following some online tutorials about adding sherlock actionbar. In every tutorial its mentioned that when I extract the library file which I downloaded from :here
I should get three folders samples, library, and website. But I didn't get them.
So I couldn't follow the rest of the tutorial. Here is the list of the files and folders I have got after extracting the folder :
actionbarsherlock build.gradle deploy_website.sh RELEASING.md
actionbarsherlock-fest CHANGELOG.md LICENSE.txt settings.gradle
actionbarsherlock-i18n checkstyle.xml pom.xml website
actionbarsherlock-samples CONTRIBUTING.md README.md
I'm using Linux mint and eclipse. Can anyone tell me how to add the sherlock library?
Why do you need to use actionbarsherlock ? Support for the action bar is added now in support library.
"From your activity, you can retrieve an instance of ActionBar by calling getSupportActionBar()."
see the link below for more info.
http://developer.android.com/tools/support-library/index.html
http://developer.android.com/reference/android/support/v7/app/ActionBar.html
Why don't you use use ActionBar Compat?
It's available in the support library v7, allows minSdk 7 and it's a library from Google.
Furthermore the development of ActionBarSherlock is stopped
1.First you need to import sherlock lib project to eclipse.
2.Now add this library project to your sample project(Right click on project ->Properties--->Android-->add library)
NOTE: your sample project path and library project path shall be same.
3.Now create a Sherlock Activity instead of simple activity by extending SherlockActivity class .
4.You also need to change theme also.
https://github.com/jfeinstein10/SlidingMenu is a good example for Sherlock download as zip and import it to you workspace i hope it help you
I have been on this problem for a couple hours. After downloading a repository from github, the only error in any .xml file is:
No resource found that matches the given name '#style/Theme.AppCompat.Light'
The code is very straightforward, but there is not one straightforward answer I have found, on how to alleviate the error.
here is the code (in file res/values/styles.xml):
<style name="AppBaseTheme" parent="#style/Theme.AppCompat.Light">
<!-- API 14 theme customizations can go here. -->
</style>
The project is located at: https://github.com/erikswed/InstaChatX
I am on Windows, using Eclipse Kepler
What are the steps for that? where is AppCompat located?
Download the support library here:
http://developer.android.com/tools/support-library/setup.html
If you are using Eclipse:
Go to the tabs at the top and select ( Windows -> Android SDK Manager ). Under the 'extras' section, check 'Android Support Library' and check it for installation.
After that, the AppCompat library can be found at:
android-sdk/extras/android/support/v7/appcompat
You need to reference this AppCompat library in your Android project.
Import the library into Eclipse.
Right click on your Android project.
Select properties.
Click 'add...' at the bottom to add a library.
Select the support library
Clean and rebuild your project.
If you are looking for the solution in Android Studio :
Right click on your app
Open Module Settings
Select Dependencies tab
Click on green + symbol which is on the right side
Select Library Dependency
Choose appcompat-v7 from list
The steps described above do work, however I've encountered this problem on IntelliJ IDEA and have found that I'm having these problems with existing projects and the only solution is to remove the 'appcompat' module (not the library) and re-import it.
Below are the steps you can try it out to resolve the issue: -
Provide reference of AppCompat Library into your project.
If option 1 doesn't solve the issue then you can try to change the style.xml file to below code.
parent="android:Theme.Holo.Light"
instead.
parent="android:Theme.AppCompat.Light"
But option 2 will require minimum sdk version 14.
Hope this will help !
Summved
I followed the steps given in http://developer.android.com/tools/support-library/setup.html#add-library
During the step: Create a library project(Adding libraries with resources), for the v7 appcompat project, I see project titled appcompat instead of android-support-v7-appcompat. Where am I going wrong? Please help.
Answer:I realized for older versions of Android SDK we get appcompat titled project not the v7 one.
I am new to Android, and I am setting up a project which needs ActionBarSherlock. I imported the last one as module inside my project so that the error warning import com.actionbarsherlock.app.ActionBar; which was entirely red, is now getting red only on ActionBar. How can I manage this ? Do I have to put ActionBarSherlock in my project lib folder rather than imported it as a module
So you have ABS library module in hand. Now, I'll tell from starting
Start a new project. Make compile with latest (jelly bean) and Theme as None.
In project explorer, navigate to libs folder and delete supportv4 jar file.
Now, include your ABS library following properties-->Android-->library
finally, change theme as,
< application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.Sherlock" >
a priori, I manage to do the trick, by importing ActionBarSherlock as module. Then, I stll got an error upon ActionBar in com.actionbarsherlock.app.ActionBar. In my code, I edited the help warning popup box showing optimizing imports and adding as dependecy module , and clicked on the latest, and it worked fine
Go to file-->import-->Android-existing code into workplace, Then select ActionBarSherlock's Library, After importing go to the properties of the project in which you wanna add actionBar.
Do this by right clicking on your project in package explorer -->properties--> under Android click add in the library section and choose the actionBarsherlock lilbrary listed there.
EDIT:
I would suggest you look here. Make sure that you have checked is library option. But what I think initially is that the library is added perfectly since its now recognising com.actionbarsherlock.app package. One common bug is that actionbarsherlock and your project both contains the android support package library, try deleting the android support library from your project since your project should be using the support library from actionbarsherlock. Remember to backup your code.
EDIT 2: You should be extending sherlockActivity instead of normal activity, same stands for Fragments, A fragment would be changed to sherlockFragment. These are the widgets that will come from sherlock library.
Refer this link also
I am using ActionBarSherlock to implement action bar on my Android 2.1 API 7 project. (With Eclipse IDE)
In order to use sherlock, after I imported sherlock library as a existing project on Eclipse. I did the following things on my own project:
mouse right click on my project, choose "properties"
in "Android" section, there is "Library" sub-section, I added sherlock project as library
Apply change
Then, I notice the FragmentActivity can not be resolved in my project source code.
I checked the project property again, the added sherlock project as library is not in "Library" section...weired!!! Why it suddenly disappeared even I have added sherlock as library? What am I missing?
I mean no matter how many times I added sherlock as library to my own project, the next time I check project property, the sherlock just disappear from library section...
First, after adding the project as a library, restart Eclipse - I believe this is a known bug with at least some versions of the plugin.
If that doesn't work, check that the 'default.properties' file in your project root is not read only.
Other known problems :
Your app should use the same "Uses-sdk" setting in AndroidManifest like your Sherlock addon
Minimum Java version for Sherlock: 1.6 !
In package with libraries, you also have a lot of samples with source code
ActionBar is not visible in Layouts
Few simple that i remember