0

I'm beginning development on an app and I set the target to Android 2.2. can i use actionbarsherlock in my app?

I added below code in pom file :

<dependency>
            <groupId>com.google.android</groupId>
            <artifactId>support-v4</artifactId>
            <version>r7</version>
        </dependency>

        <dependency>
            <groupId>com.actionbarsherlock</groupId>
            <artifactId>actionbarsherlock</artifactId>
            <version>4.4.0</version>
        </dependency>

but my app does not run in my phone with android 2.2 and i have this error :

java.lang.IllegalStateException: You must use Theme.Sherlock, Theme.Sherlock.Light, Theme.Sherlock.Light.DarkActionBar, or a derivative.

In this case what am i doing?

when i set android:theme="@style/Theme.Sherlock" in AndroidManifest.xml appear this error:

Android Resource Packaging: Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.Sherlock').

Elham Gdz
  • 1,015
  • 3
  • 15
  • 31

5 Answers5

1

You may need to update the theme in your AndroidManifest.xml

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock">
Pheel125
  • 113
  • 7
  • when i set android:theme="@style/Theme.Sherlock" in AndroidManifest.xml appear this error: Android Resource Packaging: Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.Sherlock'). – Elham Gdz Dec 04 '13 at 12:38
1

To use ActionBar in API levels lower than that, you can use ActionBarSherlock.

GOLDEE
  • 2,318
  • 3
  • 25
  • 49
0

You just need to add this attribute to your application tag in Manifest file android:theme="@style/Theme.Sherlock"

The library should be added as reference to be able to use the Sherlock Theme. For adding the library in IntelliJ check this out:

Community
  • 1
  • 1
Ankit Popli
  • 2,809
  • 3
  • 37
  • 61
0

Just use the android:theme as @style/Theme.Sherlock.Light.DarkActionBar or any other sherlock style inside your application tag in AndroidManifest file

Alex Chengalan
  • 8,211
  • 4
  • 42
  • 56
  • when i set android:theme="@style/Theme.Sherlock" in AndroidManifest.xml appear this error: Android Resource Packaging: Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.Sherlock'). – Elham Gdz Dec 04 '13 at 12:40
  • Did u add the sherlock actionbar library into your project? – Alex Chengalan Dec 05 '13 at 04:51
  • No, i did not add it into my project, should be add? – Elham Gdz Dec 10 '13 at 05:57
0

I think you should download actionbarsherlock from the website. I have no idea how to import it in IntelliJ, but maybe you can import your project in eclipse IDE (download it on the official site if you don't have one) then import actionbarsherlock to Eclipse, add it as a library to your app, then after configuring it, import the project again to IntelliJ.

Jeongbebs
  • 4,100
  • 7
  • 34
  • 60