Error importing HoloEverywhere
actionbarsherlock, android, android-holo-everywhere, themes
Solution
Follow the steps below(taken from blog here) to add `ActionBarSherlock`
- Download the .zip/.tgz and extract it
- Go to eclipse and choose `File->New-> Android Project`
- Select `Create project from existing source` and then `browse` to the `library` folder inside extracted `AndroidBarSherlock` folder
- Build Target should be the latest(14 or15), but your minSdkVersion can be less (7 or 8)
- Press `Finish`
- Right click on the newly created project and go to `Properties`.
- Under the `Android` heading, you should see a section for `Library` with a checkbox `IsLibrary`. Make sure that's checked.
- Right click -> Properies on the project in which you wish to add `AndroidBarSherlock` under the `Android` heading and the `Library` section choose `Add`.
- You should see the `ActionBarSherlock` library, add this to your project
- Lastly, if you were using the compatibility support , you need to delete that jar since it's included in ActionBarSherlock.
Follow the steps below to add HoloEverywhere
- Download Zip from GitHub to your computer
- UnZip the folder
- Go to eclipse and choose `File->New-> Android Project`
- Select `Create project from existing source` and then `browse` to the `HoloEverywhereLib` folder inside extracted folder
- Press `Finish`
- Right click on the newly created project and go to `Properties`.
- Under the `Android` heading, you should see a section for `Library` with a checkbox `IsLibrary`. Make sure that's checked and press `Add` and previously added library `ActionBarSherlock`.
Follow these steps to add `HoloEverywhere` to your project
- Create a new Android project
- Right Click on project -> Properties -> Android -> Add, add both `ActionBarSherlock` and `HoloEverywhere`
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 follows
public class ChkActionBarSherlock extends SherlockActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
Problem
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.