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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:38:24+00:00 2026-06-12T16:38:24+00:00

WHen you are designing something, you have to start with a layout. the screen

  • 0

WHen you are designing something, you have to start with a layout.

the screen will usually contain:

 [         title bar                ]
 |----------------------------------|
 |                                  |
 |         layout/activity          |
 |                                  |
 |----------------------------------|
 [         menu bar                 ]

I removed the titlebar, but trying to account for the menu bar to get the width and height of a layout or activity.

My thing is that since i do it onCreate, dimensions arent figured out yet. When the program is running, i can use the layout.getWidth(). How would i get the dimensions of my applicable workspace? If i get the screen dimensions, it is the full screen, where i dont want that…. as the menu bar is counted.

THis is for a tablet, and i cant just remove the menubar. Do any of you know?

  • 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-12T16:38:25+00:00Added an answer on June 12, 2026 at 4:38 pm

    when you have a View, you can use View.post() which will run it like a thread (hense why it is called runnable). The perk of this is that when you implement this in the root layout, it will post the contents to the screen. This, then allowing you to get the asset being looked for, screen dimensions.

    The reason why you arent getting the screen dimensions is based on the lifecycle of your program. onCreate does not have anything rendered on screen, so there is no way of knowing the dimensions of the contents by that point in the run.

    Example Code in onCreate():

    LinearLayout ll = (LinearLayout)findViewById(R.id.LinearLayout);
    ll.post(new Runnable(){
        public void run() {
            //get dimensions in here.   
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am designing something that will have a homepage close to the Google+ android
I'm currently about to start designing a new application. The application will allow a
What tools helps designing sites which would be mobile phone friendly ? Something that
How would one go about defining something like this in an xsd? <start> <request
When designing a C API for configuring a library/utility, I have a co-worker who
I have very little experience designing databases, and now I want to create a
I'm designing a daemon that will continuously read lines from a single text file
I have problem designing pseudo-code for these problems. It is not an assignment problem.
I have a dilemma with this, I am designing a project and basically it
Here is my goal. I am designing a server that will spit out data

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.