0

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

epsilones
  • 11,279
  • 21
  • 61
  • 85

3 Answers3

1

So you have ABS library module in hand. Now, I'll tell from starting

  1. Start a new project. Make compile with latest (jelly bean) and Theme as None.

  2. In project explorer, navigate to libs folder and delete supportv4 jar file.

  3. Now, include your ABS library following properties-->Android-->library

  4. finally, change theme as,

    < application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/Theme.Sherlock" >

Nizam
  • 5,698
  • 9
  • 45
  • 57
0

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

Community
  • 1
  • 1
Parvaz Bhaskar
  • 1,367
  • 9
  • 29
  • In fact I am using `intelliJ idea`, so I don't have `properties`, I think the equivalent is `Project Structure`. There I have `Libraries`, and I found some correct `gen1` folder that references the ActionBarSherlock's Library. The same way, I found the same library in as a module. I have edited my post and put it in screenshot – epsilones Aug 14 '13 at 08:58
  • Please check edit and it would be helpful if you could paste some logcat. – Parvaz Bhaskar Aug 14 '13 at 09:09
  • Ok I deleted the `android support` from external libraries and now `Fragment` is not recognized in `import android.support.v4.app.Fragment` and `ActionBar` neither in `import com.actionbarsherlock.app.ActionBar` – epsilones Aug 14 '13 at 09:29
  • import android.support.v4.app.Fragment will no longer be there since you have removed the support library, try with SherlockFragment. – Parvaz Bhaskar Aug 14 '13 at 11:06
0

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

epsilones
  • 11,279
  • 21
  • 61
  • 85