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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:54:31+00:00 2026-06-01T01:54:31+00:00

I am making UI in android using java code because all UI information comming

  • 0

I am making UI in android using java code because all UI information comming from server so we can’t use xml but there is problem when I create 7 button on screen by giving information it is supporting ldpi but rest of devices it is not working code is as-

for (int index = 0; index <7; index++) {


        Button objwidgetbutton = new Button(this);


        LinearLayout.LayoutParams objlayoutbtnparams = new LinearLayout.LayoutParams(280,LinearLayout.LayoutParams.WRAP_CONTENT); // Verbose!

        objwidgetbutton.setText("hiii");

        objwidgetbutton.setBackgroundResource(R.drawable.ic_launcher);

        llinner.addView(objwidgetbutton,objlayoutbtnparams);

    }
    objlinear.addView(llinner);

I am using this structure is as

<LinearLayout>
  <LinearLayout>
   <button/>#7
  </LinearLayout>
  </LinearLayout>

Please guide me Is I going right path or doing other things?Main things is that how to make screen support all resolution

  • 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-01T01:54:32+00:00Added an answer on June 1, 2026 at 1:54 am

    You probably want to set up some different methodologies for each of the different pixel densities. See this solution to another question. Adapt your code to work with different pixel densities, and put them in the case statements.

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

Sidebar

Related Questions

I'm making an Android app where the user can download files from a FTP-server.
I'm making a simple drawing app on Android. I'm using the FingerPaint.java provided with
Im making a program using Java for android. I'm drawing alot of rectangles on
I am making a connection from Android client to Servlet using url connection. I
I'm making an Android app using Processing, and have decided to port my code
I'm making my first game using Java on Android. I need to draw a
I'm making an OpenGLES Android app using Android NDK, expanding from android's gljni example,
I'm making an android application using phonegap. I'm using phonegap's Storage api for querying
I'm making a popup in Android using Toast, is there any way when shown
I am using ksoap2-Android for making and parsing my requests. How ever if i

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.