Today in this article I will discuss and implement ActionBarSherlocka. First we need to Know about ActionBarSherlocka. Then we are going to start implement process using the android studio.

What is ActionBarSherlocka ?

ActionBarSherlock is an extension of the support library designed to facilitate the use of the action bar design pattern across all versions of Android with a single API.

The library will automatically use the native action bar when appropriate or will automatically wrap a custom implementation around your layouts. This allows you to easily develop an application with an action bar for every version of Android from 2.x and up.


Add Using Android Studio

In Android Studio, you might do it the Graphical user interface (GUI way).

Select the module
Click Dependencies


Click the green arrow
Select 1 Maven dependency
If you don’t know actual full name of actionbersherlock simple Input sherlock and press enter to search
Wait few moment Maven Look up your search then finally you will see
Select com.actionbarsherlock:actionbarsherlock:[email protected]
Click OK


This will automatically add it to your build.gradle
Now open your build.gradle File and see the actionbarsherlocka add as dependencies.

dependencies {
    compile ''
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'

Importing Action Bar Sherlock Library to your Project

Open the Action Bar Sherlock Library you have downloaded earlier and extract it somewhere (for example to your ( C:UsersaamsuzonDownloads ). After extraction, the directory should look like this:


Copy the directory called “actionbarsherlock” to your project root directory. After copying, your project root directory should look like this:


Now we need to modify the settings.gradle to tell Gradle that we have to include another project on our build. settings.gradle is located on your project root ( YourApplicationProject/settings.gradle ).

Let us include the actionbarsherlock directory in your:settings.gradle

 include ':YourApplication', ':actionbarsherlock'

Now your Gradle is ready to compile. But before you can start coding, we need to configure Android Studio and tell about the library.

Adding Action Bar Sherlock library to Android Studio

Select the module
Click Dependencies
Click the green arrow
Select  Module Dependency
Select the actionbarsherlock and then click Apply then OK to quit the Project Structure. Restart again the Android Studio.

You can now start coding your project using the Action Bar Sherlock.

Testing the Action Bar Sherlock

Open File in your project. Import this line


Now  let’s change the activity to sherlockactivity. We need to remove the onCreateOptionsMenu override method as this does not exist.

package com.example.yourapplication;

import android.os.Bundle;
//import android.view.Menu;


public class MainActivity extends SherlockActivity {

protected void onCreate(Bundle savedInstanceState) {

/* @Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(, menu);
return true;


Almost done!! now we just need to modify the AndroidManifest.xml of our application to change the theme to the Action Bar Sherlock library themes.

To Action Bar Sherlock Light dark theme apply add this line


Your application will now able to run the Action Bar Sherlock library

If you face any problem to do this please write a comment.or if you have any others way to easily use the lib then write comment here

As an Amazon Associate I earn from qualifying purchases.