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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:16:23+00:00 2026-05-28T02:16:23+00:00

I have putting such data into LinearView. as like below code: public void showResult()

  • 0

I have putting such data into LinearView. as like below code:

public void showResult()
{
    //db.open();
    //c2 = db.getAllTitles(table_name);

    List<TextView> textListWord = new ArrayList<TextView>(tempEmployerList.size());
    List<TextView> textListAnswer = new ArrayList<TextView>(tempEmployerList.size());
    List<TextView> imageListAnswer = new ArrayList<TextView>(tempEmployerList.size());

    //for(int i = 0; i < c.getCount(); i++)

    //int limit = tempEmployerList.size(); 

    for(int i = 0; i<=tempEmployerList.size()-1; i++)
    {    
        RelativeLayout innerLayout = new RelativeLayout(this);
        innerLayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
        innerLayout.setBackgroundColor(0x00000000);

        // set the Multiple TextView
        TextView qWordTV = new TextView(getApplicationContext());
        TextView aWordTV = new TextView(getApplicationContext());
        TextView aImageView = new TextView(getApplicationContext());

        qWordTV.setText("\n"+"1");
        qWordTV.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
        qWordTV.setTextColor(0xFFFF0000);
        qWordTV.setPadding(3, 0, 0, 0);

        aWordTV.setText("\n"+"2");
        aWordTV.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
        aWordTV.setGravity(Gravity.CENTER);
        aWordTV.setTextColor(0xFFFF0000);    
        aWordTV.setGravity(Gravity.CENTER);
        aWordTV.setPadding(40, 0, 0, 0);
        aWordTV.setTextColor(0xFFFF0000);


        aImageView.setText("\n"+"3");
        aImageView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
        aImageView.setGravity(Gravity.RIGHT);
        aImageView.setTextColor(0xFF000000);
        aImageView.setPadding(0, 0, 9, 0);


        /**** Any other text view setup code ****/    

        innerLayout.addView(qWordTV);
        innerLayout.addView(aWordTV);
        innerLayout.addView(aImageView);

        myLinearLayout.addView(innerLayout);

        textListWord.add(qWordTV); 
        textListAnswer.add(aWordTV);
        imageListAnswer.add(aImageView);

    } 
    //while (limit==0);

}

Now i want to create the Simple View dynamicaly here. . .
As like:

<View android:layout_height="2dip" android:background="#FF000000" />

in xml.

Now how to make such View like line dynamicaly ?
Please help me in this.
Thanks.

  • 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-28T02:16:23+00:00Added an answer on May 28, 2026 at 2:16 am
    View line = new View(getApplicationContext());
    line.setBackgroundColor(0xFF000000);
    // You may need to convert dip to px here, raw pixels are used in the example:
    LayoutParams layoutParams = new LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT, 2);
    line.setLayoutParams(layoutParams);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen the following methods of putting JavaScript code in an <a> tag:
I have some code that I am putting in the code-behind of a master
I have a large database and am putting together a report of the data.
I have found services like ClearSpring and Widgetbox for putting content snippets onto a
I have been putting off developing this part of my app for sometime purely
I'm writing a MVVM app and have started putting in a few animations. I
i have an idea of putting my blog on to Azure instead of a
I have some NSViews that I'm putting in one of two layouts depending on
I have an ASP.Net project using AJAX that I am putting on a server
I am putting together some ideas for our automated testing platform and have been

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.