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 7067657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:13:44+00:00 2026-05-28T05:13:44+00:00

I want to create tabbed ActionBar (NAVIGATION_MODE_TABS) with custom view (DISPLAY_SHOW_CUSTOM). It should looks

  • 0

I want to create tabbed ActionBar (NAVIGATION_MODE_TABS) with custom view (DISPLAY_SHOW_CUSTOM). It should looks like this:

enter image description here

I just need to be able to navigate through the activities via buttons in the top row – as I would do with ActionBar in normal – non tabbed mode, and also be able to switch tabs in second row. If I set ActionBar to be in a tabbed mode, the custom view disappears, it seems that tabbed mode and custom view are mutually exclusive… Is it even possible?

There are more possible ways how to do that without ActionBar. Normally I would create a layout with buttons, include it in the TabActivity (which is now deprecated) and that’s all. But I do not feel it would be the best solution, so any help or advice is appreciated.

Thanks in advance.

EDIT: After a little research I found that it works, it is just not gets displayed on my 4 inch screen. However it still does not work as I expected. On wider screens a custom view shows on the right side of the tabs – it is ok, but on the 4 inch phone screens it is not displayed at all.

I think the best solution is to use ActionBarSherlock library (I do not like using deprecated features and my app must work also on pre – sdk11 version devices) and fragments – one for top ActionBar and the second for tabbed view.

  • 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-05-28T05:13:44+00:00Added an answer on May 28, 2026 at 5:13 am

    The buttons in the top row have to be added as optionMenu items:

    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
        for (int i = 0; i < menuItems; i++)
        {
            if (i == 0)
            {
                menu.add(R.string.home).setIcon(R.drawable.button_home).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
                menu.getItem(0).setOnMenuItemClickListener(this);
    
            }
        }
    
        return super.onCreateOptionsMenu(menu);
    }
    

    The philosophy of the ActionBar is slightly different then I supposed to be when asking. From the Android developer guide:

    When you want to provide navigation tabs in an activity, using the action bar’s tabs is a great option (instead of using TabWidget), because the system adapts the action bar tabs for different screen sizes—placing them in the main action bar when the screen is sufficiently wide, or in a separate bar (known as the “stacked action bar”) when the screen is too narrow.

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

Sidebar

Related Questions

I want create arrays with object keys in PHP, i.e. something like this: <?php
I want create subdomains like this: domain.com/type/city An examples: domain.com/restaurants/new_york domain.com/hotels/new_york domain.com/restaurants/chicago I have
I want to create a tabbed view of pages similar to that of the
I want to create my Rails application with MySQL, because I like it so
I want create a pdf using iText. The method which does this is a
I want create Word document from another Word document, but I need replace some
I am new to Javascript I want to create tabbed menu bar in that
I have a tabbed application where I want the user to be able to
I want to create a simple tabbed interface app. I did it before in
i want create one simple windows form ,it just contain Editcontrol(textbox),Static Edit(label),Button (Name of

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.