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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:21:52+00:00 2026-06-01T00:21:52+00:00

I am developing an UI(Home screen) just like this screen given in this link

  • 0

I am developing an UI(Home screen) just like this screen
given in this link
http://www.flickr.com/photos/78431491@N07/7023063473/

-all information are comming from xml which is available on server means
1- number of button on screen
2- size, background images of screen and buttons,text on button each and everythings coming from
server
so we can’t use xml for creating layout.I have been comleted tabbar and when I am creating buttons that is not taking any properties code used by me is as-

TabHost tabHost = getTabHost();
        TabHost.TabSpec spec;
        Intent intent;
        int id = getResources().getIdentifier("com.correlation.edumationui:drawable/" + img, null, null);
        intent = new Intent().setClass(this, HomeScreen.class);//HomeScreen.class);
        Bundle objbundle = new Bundle();
        objbundle.putSerializable("screen", mscreen);
        intent.putExtras(objbundle);
        spec = tabHost.newTabSpec("title").setIndicator(title,getResources().getDrawable(id))
                      .setContent(intent);
        tabHost.addTab(spec);   

for creating button i am using this code–in homescreen Activity( HomeScreen.class)

LinearLayout buttonsView = new LinearLayout(this);
    buttonsView.setOrientation(LinearLayout.VERTICAL);

    for (int r = 0; r < 6; ++r)
    {
     Button btn = new Button(this);
     btn.setText("A");
     btn.setHeight(30);
     btn.setWidth(224);
     btn.setPadding(10,10,10,10);
     LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT); // Verbose!
     lp.weight = 1.0f; // This is critical. Doesn't work without it.
     buttonsView.addView(btn, lp);
    }
    ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
    setContentView(buttonsView, lp);

give me your valuable help….

  • 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-01T00:21:53+00:00Added an answer on June 1, 2026 at 12:21 am

    Instead of

      LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT); // Verbose!
     lp.weight = 1.0f; // This is critical. Doesn't work without it.
     buttonsView.addView(btn, lp);
    

    Use

       LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(30, 224); // Verbose!
       lp.weight = 1.0f; // This is critical. Doesn't work without it.
       buttonsView.addView(btn,lp);
    

    to reflect the width and height of buttons in layout parameters.

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

Sidebar

Related Questions

I'm developing a home security application. One thing I'd like to do is automatically
I am developing a website for vacation home rentals, and I would like some
I'm developing a mobile web application and I have a home screen with a
We are developing a Java application for BlackBerry. We have the home screen in
I am developing a buissness-application that is essentially a Home-screen, and is supposed to
I'm developing a 'home-made' tooltip using Jquery and CSS, Seems to work OK, http://jsfiddle.net/GLZFc/
I've been trying to push my mentallity when developing at home to be geared
I'm developing a web site containing 3 pages (Home, page2, page3) ... in the
I'm developing an application on two different machines (home and work) and while the
Up till now I have been developing my personal and school projects at home

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.