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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:39:04+00:00 2026-06-15T13:39:04+00:00

What I want to do is create a layout of checkboxes where the number

  • 0

What I want to do is create a layout of checkboxes where the number of checkboxes is decided by the user.

like if i say 5 then on the next page of my app, 5checkboxes should appear.
also, I want the text besides this checkbox to be auto filled from 1 to 5.

Or suppose I replace checkboxes with buttons, the buttons shold be created dynamically and also,in case of the buttons, the button should change color to represent that it is clicked.

how do I do this?

Thankyou!

  • 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-15T13:39:05+00:00Added an answer on June 15, 2026 at 1:39 pm

    This is a snippet from my code. Which doeas what you are asking for.

    // get the parent element which will hold your newly created objects
    LinearLayout layout = (LinearLayout) findViewById(R.id.shouldContainer);
    
    // create the laout parameters objects which will hold information how you would like your widget to be presented
    //you can specify the same attributes as doing it "staticly" with XML file
    LayoutParams layoutParams = new LayoutParams(LayoutParams.FILL_PARENT, 0);
    layoutParams.weight = 1;
    
    //create your desired object, add listneres to it, text and more
    Button button = new Button(this);
    //add your object, in this case button to the parent element on given position with given layout parameters
    layout.addView(button, position, layoutParams);
    

    Of course you have to configure the layout options according to your needs.

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

Sidebar

Related Questions

I want to create a layout like the User page on Stack Overflow where
I want to create layout like this on facebook app. Тo appear with effect
I want to create a layout like this for android cellphone app I have
I want to create a layout for an Android app that has a numeric
I've got a problem with my page's layout. I want to create 3 table
I want to create a layout like below.. This is the XML i have
I have the following picture and I want create layout like it, and I
Hi i want to create dynamical number of checkboxes (it depends on the length
I want to create layout like on the image 3 green layouts are linearlayouts
I want to create a layout like this: On the top a TextView, after

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.