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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:47:20+00:00 2026-06-12T02:47:20+00:00

I have a relative layout <RelativeLayout android:layout_width=match_parent android:layout_height=wrap_content > <ImageView android:id=@+id/ivLogo android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentLeft=true

  • 0

I have a relative layout

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <ImageView
        android:id="@+id/ivLogo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:src="@drawable/ic_launcher" />

    <Button
        android:id="@+id/b2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:text="Button" />

    <Button
        android:id="@+id/b1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_toLeftOf="@+id/b2"
        android:text="Button" />

    <TextView
        android:id="@+id/tvName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_marginLeft="21dp"
        android:layout_toRightOf="@+id/ivLogo"
        android:text="Large Text"
        android:textAppearance="?android:attr/textAppearanceLarge" />

</RelativeLayout>

which contains an imageview, textview, and two buttons, and what I want is to make a list of a info to be filled in this layout auto .. umm, like making in the java file “Heart.png”, heart, http://www.heart.com, 69552874 .. then when I start the app the info I typed in the java class gets in the activity .. the “heart.png” gets in the ivLogo imageview, and the http://www.heart.com gets into b1 button, like this ..

I can achieve what i want using the xml but it will take a long of time and it’ll be very slow because ill be many imageviews .. I want to make a list of things with their logo and name and num. and website , like can the java make a new relative layout for every info ..

like if i write

"Heart.png", heart1, www.heart.com, 69552874
"Heart.png", heart2, www.heart.com, 69552874
"Heart.png", heart3, www.heart.com, 69552874

I see in the app 3 relative layouts for each heart 1,2, and 3 ..
I want a method to do that not using the xml for each one make a new relative layout

isn’t there something like makenewLayout etc … ?

sorry for taking long, a two words hint will be nice to me <3

  • 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-12T02:47:21+00:00Added an answer on June 12, 2026 at 2:47 am

    Yes, you can do this in code.

    RelativeLayout layout = new RelativeLayout(this);
    ImageView iv = new ImageView(this);
    iv.setId(ivid);
    ....
    ....
    TextView tv = new TextView(this);
    tv.setId(tvid);
    tv.setText("My text");
    ...
    layout.addView(iv);
    layout.addView(tv);
    setContentView(layout);
    

    Put this in a function, and call the function for various images, textviews, etc.

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

Sidebar

Related Questions

I have a layout defined in XML. It contains also: <RelativeLayout android:id=@+id/item android:layout_width=fill_parent android:layout_height=wrap_content
I have RelativeLayout with RelativeLayout title bar: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent android:layout_height=wrap_content android:gravity=center_horizontal android:orientation=vertical >
I have a dialog with this content: <RelativeLayout android:layout_width=wrap_content android:layout_height=wrap_content > <ScrollView android:layout_width=fill_parent android:layout_height=wrap_content
I have the following layout: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:background=@drawable/aussie_bg_big > <ImageView android:id=@+id/titleImage android:layout_width=wrap_content
In my xml I have: <RelativeLayout android:id=@+id/mainWeek android:layout_height=387dip android:layout_width=match_parent android:layout_marginTop=5dip> <RelativeLayout android:id=@+id/day1 android:layout_marginTop=5dip android:layout_marginLeft=5dip
I have EditText in my XML as <!-- Inside RelativeLayout --> <EditText android:id=@+id/edtEmail android:layout_width=match_parent
I have designed the screen using this relative layout. <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android
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
My XML: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent android:layout_height=match_parent android:background=#FFFFFF android:orientation=vertical > <ImageView android:id=@+id/imageMenu android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentLeft=true
So, I have this layout: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/layout android:layout_width=fill_parent android:layout_height=wrap_content android:background=#FFFF00

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.