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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:57:05+00:00 2026-06-09T23:57:05+00:00

Android seems to be cutting off the bottom 100px on devices that have virtual

  • 0

Android seems to be cutting off the bottom 100px on devices that have virtual / on screen buttons. Is it possible to detect if the current phone / tablet is using on screen buttons so that I can account for the missing space? If so, is it possible to get the height of the buttons as well?

  • 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-09T23:57:06+00:00Added an answer on June 9, 2026 at 11:57 pm

    You can check if the device has a permanent (hardware) menu button by using hasPermanentMenuKey(). It can be used as following:

    boolean hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey();
    

    Notice that this technique will work only on APIs 14+ (ICS, JB). No device pre-API-11 has menu buttons, so that leaves only APIs 11-13 without a check; keep in mind that these 3 API levels have only 2.3% of the Android population currently.

    Alternately (though not reliably), you could try searching for a D-Pad:

    boolean hasDpad = getResources().getConfiguration().naviation == Configuration.NAVIGATION_DPAD;
    

    There is no way to check for a hardware search button (and I would assume home/back as well), as seen here. (Also here; this thread proposes an alternative method, though I’m not sure it will work in your case.)

    I will mention two things: The virtual buttons should NEVER be covering your content. They do subtract from the height of the device window (as fetched by the display’s metrics), but they will never hinder your layout if you are using match_parent as a height. Second, there is no way to fetch the exact height of the virtual button bar; it may change between builds. There is also no native way in the Android API to fetch the “available” screen space (the area that is not covered by the bar at the bottom).

    So, here is what I will suggest:

    • Forget checking for hardware buttons. You should only be concerned with how much space you have, not how much you are losing (or why you are losing it).
    • Make a custom layout type (extending ViewGroup or LinearLayout or something).
    • Wrap your existing layout in this layout.
    • You can now override [onLayout()](http://developer.android.com/reference/android/widget/LinearLayout.html#onLayout(boolean, int, int, int, int)) or onMeasure(), and get your layout’s exact height from this. (You may want to use this for reference.)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems that android has enforced that a listview must have the name android:id=@android:id/list,
From another stackoverflow question, it seems that Android handles large bitmaps differently than other
It seems the java.net.NetworkInterface implementation of android does not have a byte[] getHardwareAddress() method
It seems that I accidentally checked in my gen folder from an Android project
Looking at the Android tutorial on: http://developer.android.com/guide/topics/fundamentals/fragments.html ... it seems fragments have their layouts
I'm using the stackmob API in an android project and it seems that the
I am just beginning to work on android and seems like I have got
I have tried to use the JSON in the android but it seems to
Android SDK seems to have a good wrapper interfaces in package android.database.sqlite, can this
My original question regarding Consuming Custom Request Methods with Android seems to have garnered

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.