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

  • Home
  • SEARCH
  • 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 7040677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:56:48+00:00 2026-05-28T01:56:48+00:00

I have to create the Layout (in xml or in java) as like Below

  • 0

I have to create the Layout (in xml or in java) as like Below image :

enter image description here

But it should be repeated as per the Condition.
Suppose, if the Arraylist.size() is more then 2 then the whole layout should be repeated as such time.
is it possible?

if yes then let me know how it is possible.

I want to create such layout in verticle direction of the linear layout.

Thanks.

Edited:
with jin35 answer i have done like this:

private void doCalculationForMultipleEmployee() {
    singleEmployee.setVisibility(View.GONE);
    for (int i = 0; i<=tempEmployerList.size()-1; i++) {     
        View repeatedLayout = LayoutInflater.from(getApplicationContext()).inflate(R.layout.test);     
        ((TextView)repeatedLayout.findViewById(R.id.list_title)).setText("Employee"+i);     
        // customize repeatedLayout with other data     
        myLinearLayout.addChild(repeatedLayout); 
    }
}

But i got syntex error at .inflate and at .addChild
Please help me for that.
Whats wrong with that ?

  • 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-05-28T01:56:48+00:00Added an answer on May 28, 2026 at 1:56 am

    You should create xml file with LinearLayout and another xml with you “repeating” layout. Then in code for every part of data just use this:

    for (Employee e : employeeList) {
        View repeatedLayout = LayoutInflater.from(context).inflate(R.your_repeated_layout);
        ((TextView)repeatedLayout.findViewById(R.id.employee_salary)).setText(e.getSalary())
        // customize repeatedLayout with other data
        yourLinearLayout.addChild(repeatedLayout);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have create some xml layout and i java files, some xml file have
i have to create an asp.net page dynamically on runtime. It should work like
If I have a page whose layout is designated by XML code, but I
I know how to screen1.xml to screen2.xml, with onClick method in my .java. But
I have tried all that i could to generate the R.java file but in
I copied a .java class and .xml layout. I thought I renamed everything in
Hi to all, i have written something like this in the xml file <?xml
In My Application, My XML layout is like this: <RelativeLayout android:layout_width=fill_parent android:layout_height=fill_parent> <View class=com.project.twsbi.FingerPaint$MyView
I have a Java web application that currently uses Log4J for logging. I'd like
Is it possible to convert R.java into layout file xxx.xml.. In some project which

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.