First of all, I am new with Android. I am doing an app, and I am implementing a library called HoloEverywhere. This library use in the themes.xml the library ActionBar Sherlock. I have imported to my workspace ActionBar Sherlock and I have added it to HoloEverywhere. Next, I have added HoloEverywhere to my project, but when I try to use it, I have an error (I tried to use a button):
The following classes could not be instantiated:
- com.WazaBe.HoloEverywhere.ButtonHolo (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse.
I put the path of the class in my layout, like this:
<com.WazaBe.HoloEverywhere.ButtonHolo
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/text" />
How I can solve this problem and use this library in my project?. Thanks :) PS. Sorry for my english, I know it is not very good.
The creator of ActionBarSherlock, Jake Wharton, announced on Google+ that further development of ActionBarSherlock has been stopped. ActionBarSherlock 4.4 is the last release and might get bug fixes – but there won’t be any new features:
https://plus.google.com/+JakeWharton/posts/F3HkWY9J8fK
As i asked on holoeverywhere issues forum and answered by devs:
So you should not use ABS anymore and remove the library from your project and replace it holoeverywhere directly or with ActionbarCompat from google support library.
Follow the steps below(taken from blog here) to add
ActionBarSherlock
File->New-> Android Project
Create project from existing source
and thenbrowse
to thelibrary
folder inside extractedAndroidBarSherlock
folderFinish
Properties
.Android
heading, you should see a section forLibrary
with a checkboxIsLibrary
. Make sure that's checked.AndroidBarSherlock
under theAndroid
heading and theLibrary
section chooseAdd
.ActionBarSherlock
library, add this to your projectFollow the steps below to add HoloEverywhere
File->New-> Android Project
Create project from existing source
and thenbrowse
to theHoloEverywhereLib
folder inside extracted folderFinish
Properties
.Android
heading, you should see a section forLibrary
with a checkboxIsLibrary
. Make sure that's checked and pressAdd
and previously added libraryActionBarSherlock
.Follow these steps to add
HoloEverywhere
to your projectActionBarSherlock
andHoloEverywhere
Change the
Android Manifest
to following<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/Holo.Theme">
Edit you
main.xml
to include Holo theme widgets.Change your
activity
as followsIt seems that
cause an error.
change it:
resons here:
Github
correct!
I had the same error on my project, This is what I did, right click the HoloEverywhere (properties->android->library) remove the ActionBarSherlock from the list then re-add the ActionBarSherlock project by click add, after that clean up the project and all errors will disappear.