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

  • SEARCH
  • Home
  • 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 9236787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:22:54+00:00 2026-06-18T07:22:54+00:00

I have an app with multiple tabs in an Action Bar, and each tab

  • 0

I have an app with multiple tabs in an Action Bar, and each tab has a different set of option menu icons that show up in the Action Bar. Some tabs have two icons, some have none.

The problem is that when I swipe between the screens, the buttons for the individual screens may or may not show up. I.e. on a screen where there should be two icons, there will be no icons in the Action Bar!

When I click the tabs, however, the screens always show the correct icons without fail.

I have tried analyzing the problem in the debugger. I’m certain that the FragmentPagerAdapter is correctly calling setMenuVisibility(true) for the newly selected Fragment, and other Fragments are called with setMenuVisibility(false).

I can’t find an exact pattern to the appearance/disappearance of buttons. I can swipe left/right between two screens that each have two different buttons. The problem will occur anywhere after 1 to 20 swipes.

The disappearance seems to be aggravated by swiping to a screen with one icon and then back to a screen with two icons.

I have tried adding calls into the Activity.invalidateOptionsMenu() but it seems to have no affect. For example, I added this call into my TabAdapter’s onPageScrollStateChanged() which is called after the swipe animation is complete. I’ve also tried adding this into the Fragments’ onResume() or after TabAdapter.onTabSelected() is finished, to no avail.

I am using ActionBarSherlock 4.1.0 (and I’ve substituted in the latest android-support-v4.jar because of a different issue). My Activity extends SherlockFragmentActivity and simply instantiates a ViewPager. I have overridden the FragmentPagerAdapter for the ViewPager’s adapter (following the standard example on the ViewPager Android docs).

My phone is running Android 2.3.5.

  • 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-18T07:22:56+00:00Added an answer on June 18, 2026 at 7:22 am

    Several workarounds for this issue are provided in ViewPager / ActionBar, Menu Items not displaying. The fix discussed in item #8 worked for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple tabs (more than 5) in the tab bar in my app,
I have an app that supports multiple brands, each having their own color scheme,
I have an app that uses multiple WebView s next to each other to
I have created an app with multiple tabs, each with its own layout. I
I have an app that makes multiple connections to different servers at the same
I have multiple app processes that each connect to servers and receive data from
I have a tab bar that I want to add to multiple activities. I
I have an app that sends multiple Ajax requests simultaneously. I was originally running
I have a Django app where multiple teams upload content that will be parsed.
I currently have an app that requires connection to a server in multiple activities.

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.