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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:51:19+00:00 2026-06-13T19:51:19+00:00

I have an activity configured with splitActionBarWhenNarrow that uses requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY) . And I need

  • 0

I have an activity configured with splitActionBarWhenNarrow that uses requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY).

And I need to check if screen is considered narrow to know if splitbar is visible because I have to change the position of one bottom component to don’t overlap with splitActionbar when visible.

PD: I know how to check orientation but I’m not sure if portrait is always equal to narrow

  • 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-13T19:51:21+00:00Added an answer on June 13, 2026 at 7:51 pm

    By checking the ActionBarSherlock sources I’ve found a solution that seems to work very well: Create a values.xml in your values resource directory and add a new boolean property like this:

    <resources>
        <bool name="screen_is_narrow">true</bool>
    </resources>
    

    Then create a second values.xml in the values-w480dp directory:

    <resources>
        <bool name="screen_is_narrow">false</bool>
    </resources>
    

    This second resource will automatically be loaded if the screen is wider than 480dp. In portrait mode your phone screen is smaller than that so screen_is_narrow is true whereas in landscape mode and on tablets it is wider and thus screen_is_narrow becomes false.

    Based on that logic you can simply do a check in your Activity code now:

    boolean screenIsNarrow = getResources().getBoolean(R.bool.screen_is_narrow);
    

    That should do the trick. In case you’re already using ActionBarSherlock then there’s an even easier solution as the booleans have been predefined already. Simply check for R.bool.abs__split_action_bar_is_narrow in your code.

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

Sidebar

Related Questions

I have an Activity that usually needs some time to watch the screen without
I have an Android activity utilizing a JNI library that uses netlink commands to
I have an Activity and Service that work together in my application. I've configured
I have a widget that is configured through an activity (I do not want
I could send mail from my Activity when i have already configured with any
I have an activity that when users press share on a file it would
I have an Activity A that calls an Activity B using startActivityForResult() . Under
I have an activity with the following layout. So in this screen, initally the
I have activity A that starts activity B which starts activity C: A ->
I have an application that depends on connection It has many Activities.I need 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.