Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9121261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:49:14+00:00 2026-06-17T05:49:14+00:00

I have just implemented in my Android Application the Sherlock’s ActionBar. The issue is:

  • 0

I have just implemented in my Android Application the Sherlock’s ActionBar.

The issue is: as you can see from image, my SupportMapFragment of Google Maps API v2, loaded in the MainActivity, is completely overlayed by the actionBar. I have already done some tests: load a different fragment, for example a simple SherlockListFragment, but the result is absolutely the same, and to DON’T set the setListNavigationCallbacks (beacuse the problem could be my custom SpinnerAdapter) but the actionBar always covers all the screen, even without any text in it.

IMAGE:
https://www.dropbox.com/s/y0lnekjttdzv2xa/2012-12-18_14-45-43.png

Some Code from my app:

Main.java

public class Main extends SherlockFragmentActivity implements ActionBar.OnNavigationListener 
{
private static final String STATE_SELECTED_NAVIGATION_ITEM = "selected_navigation_item";
private FragmentMappa fMappa;
private FragmentLinee fLinee;
private FragmentAtmInforma fAtm;

@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    fMappa = new FragmentMappa();
    fLinee = new FragmentLinee();
    fAtm = new FragmentAtmInforma();
    setContentView(R.layout.activity_main);

    int IdFixedHeader = -1;
    Utils.ImpostaActionBar(IdFixedHeader, this);

    getSupportFragmentManager().addOnBackStackChangedListener(getListener());
    getSupportFragmentManager().beginTransaction().replace(R.id.MainContainer, fMappa).commit();
    new downloadUtils().execute(0, this, true);
}

Utils.java

public static void ImpostaActionBar(int IdFixedHeader, SherlockFragmentActivity Act, String StrFixHead) {
    // Set up the action bar to show a dropdown list.
    ActionBar actionBar = Act.getSupportActionBar();
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    ArrayList<VoceListaMenuNav> Voci = new ArrayList<VoceListaMenuNav>();
    Voci.add(new VoceListaMenuNav(Act.getString(R.string.title_mappa), R.drawable.btn_show_map));
    Voci.add(new VoceListaMenuNav(Act.getString(R.string.title_linee), R.drawable.btn_compass_tilt));   
    Voci.add(new VoceListaMenuNav(Act.getString(R.string.title_percorso), R.drawable.fer));
    Voci.add(new VoceListaMenuNav(Act.getString(R.string.title_preferiti), R.drawable.btn_show_map));
    Voci.add(new VoceListaMenuNav(Act.getString(R.string.title_AtmInforma), R.drawable.btn_show_map));
    // Set up the dropdown list navigation in the action bar.
    actionBar.setListNavigationCallbacks(new AdapterListaMenuNav(Act.getSupportActionBar().getThemedContext(), Voci, IdFixedHeader, StrFixHead), (OnNavigationListener) Act);
    actionBar.setSelectedNavigationItem(IdFixedHeader);
}

styles.xml

<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppTheme" parent="Theme.Sherlock.Light.DarkActionBar">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    <item name="android:windowActionBarOverlay">true</item>
    <item name="android:windowActionModeOverlay">true</item>
    <item name="android:actionBarStyle">@style/ActionBar</item>
</style>

<color name="GrigioSemiTrasp">#af000000</color>

    <style name="ActionBar" parent="Widget.Sherlock.Light.Spinner.DropDown.ActionBar">
    <item name="android:background">@color/GrigioSemiTrasp</item>
</style>
</resources>

My custom adapter:

public class AdapterListaMenuNav extends BaseAdapter
{
@Override
public View getView(int arg0, View arg1, ViewGroup parent) {
    View rowView = arg1;
    if (rowView == null)
    {
      rowView = inflater.inflate(R.layout.list_item_menu_nav_top, null);
      ViewHolderListaGenerica viewHolder = new ViewHolderListaGenerica();
      viewHolder.Titolo = (TextView) rowView.findViewById(R.id.ListaMenuNavTitolo);
      rowView.setTag(viewHolder);
    }
    if (FixedHeader == -1)
    {
        ViewHolderListaGenerica holder = (ViewHolderListaGenerica)rowView.getTag();
        VoceListaMenuNav f = LisVoci.get(arg0);
        holder.Titolo.setText(f.Titolo);
        return rowView;
    }
    else
    {
        ViewHolderListaGenerica holder = (ViewHolderListaGenerica)rowView.getTag();
        VoceListaMenuNav f = LisVoci.get(FixedHeader);
        holder.Titolo.setText(f.Titolo);
        return rowView;
    }
}

Context Ctx;
ArrayList<VoceListaMenuNav> LisVoci;
LayoutInflater inflater;
int FixedHeader;

public AdapterListaMenuNav(Context Cont, ArrayList<VoceListaMenuNav> ListaVoci, int IdFixedHeader, String StrFxHeader)
{
    LisVoci = ListaVoci;
    inflater = (LayoutInflater)Cont.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    Ctx = Cont;
    FixedHeader = IdFixedHeader;
}

@Override
public int getCount() {
    return LisVoci.size();
}

@Override
public Object getItem(int arg0) {
    return null;
}

@Override
public long getItemId(int arg0) {
    return 0;
}

@Override
public View getDropDownView(int arg0, View arg1, ViewGroup arg2) {
    View rowView = arg1;
    if (rowView == null)
    {
      rowView = inflater.inflate(R.layout.list_item_menu_nav, null);
      ViewHolderListaGenerica viewHolder = new ViewHolderListaGenerica();
      viewHolder.Titolo = (TextView) rowView.findViewById(R.id.ListaMenuNavTitolo);
      viewHolder.Immagine = (ImageView) rowView.findViewById(R.id.ListaMenuNavImage);
      rowView.setTag(viewHolder);
    }

    ViewHolderListaGenerica holder = (ViewHolderListaGenerica)rowView.getTag();
    VoceListaMenuNav f = LisVoci.get(arg0);
    holder.Titolo.setText(f.Titolo);
    holder.Immagine.setImageResource(f.IdImage);
    return rowView;
}

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:49:15+00:00Added an answer on June 17, 2026 at 5:49 am

    I struggled to find out anything and finally can answer myself. The problem was from WHAT the ABS style was inheriting from. The correct code is:

    <style name="ActionBar" parent="Widget.Sherlock.Light.ActionBar">
    ....
    </style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Building an Android application using Google's GCM service. I have implemented the onRegistered method
I have just started with android ... I have to develop an android application
In my Android application I have created an SVG image converter class. It parses
The set-up: I have an android application that so far can register a user
I have an image I am displaying to a user in my android application.
I have an Android application with some ImageButtons, just like icons. I would like
I have implemented a simple Android application that I now would like to test
I am just testing out the onLocationChanged method in Android , I have implemented
I currently have an application, which is just a standard android app, but I
I have just implemented WMD for my editor in an ASP.NET app. The problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.