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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:17:50+00:00 2026-06-13T02:17:50+00:00

I am trying to implement an action bar with tabs as navigation options. To

  • 0

I am trying to implement an action bar with tabs as navigation options. To do that I select the “Tabs+Swipe” option in the “New Blank Activity” section of the “New Android App” wizard as shown below.

Tab+Swipe wizard option

Now, in the android manifest, when

android:targetSdkVersion="15"

which is the default value, the action bar looks like this on a Nexus 7/Nexus 7 emulator, this is the desired look of the app

Default behavior

Now when I change that line in the android manifest to

android:targetSdkVersion="16"

the look of the action bar changes to this

Behaviour after android:targetSdkVersion="16"

The default look remains for any version of android but 16, can anyone please explain why the look of the action bar suddenly changes when the targetSdkVersion is set to 16?

The above is reproducible in the emulator as as well as on a real nexus 7.

Full screengrabs for

Normal: https://i.stack.imgur.com/VsBA2.png

After android:targetSdkVersion=”16″: https://i.stack.imgur.com/OM6Y4.png

Update-10th March, 2013: Switched to the List Navigation mode (instead of Tabs) to enable move to android:targetSdkVersion=17

  • 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-13T02:17:51+00:00Added an answer on June 13, 2026 at 2:17 am

    The reason it changes when setting targetSDK to 16 is because Google changed how tabs are measured in Jelly Bean. Specifically, look at this in android.internal.view.ActionBarPolicy:

    public boolean hasEmbeddedTabs() {
        final int targetSdk = mContext.getApplicationInfo().targetSdkVersion;
        if (targetSdk >= Build.VERSION_CODES.JELLY_BEAN) {
            return mContext.getResources().getBoolean(R.bool.action_bar_embed_tabs);
        }
    
        // The embedded tabs policy changed in Jellybean; give older apps the old policy
        // so they get what they expect.
        return mContext.getResources().getBoolean(R.bool.action_bar_embed_tabs_pre_jb);
    }
    

    However, I suspect you don’t just want the reason, but a solution. Unfortunately, I can’t give you a straightforward way to set it to only embedded.

    I can suggest using ActionBarSherlock to make it consistent, though. The bonus to that is the ability to use actionbars on older devices. When using it(portrait), I can confirm that if you set the targetSDK to 16, it uses the stacked layout on Jelly Bean, Ice Cream Sandwich, GingerBread, and Froyo. At least you will be able to design your layout while knowing what to expect.

    Keep in mind that in most cases, switching to landscape mode will embed them in the actionbar again, since there is “enough room” the way it measures.

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

Sidebar

Related Questions

I am trying to implement an action bar within an activity. Is it possible
I'm trying to implement a drop down list as navigation for the action bar
i'm trying to implement action bar in 2.3.3 version. As i'm new to android
I am trying to implement something like an action bar in android 2.2 .
I'm trying to implement an action bar in my app. I'm trying to do
I using action bar by sherlock. I'm trying to implement it into my app.
i am trying to implement an action sheet that contains a picker view and
I am trying to implement a action bar in my app.I followed the method
Ok I have an app that implements tabs in the action bar using fragments.
I'm trying to implement a navigation controller with some hierarchical views. I want to

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.