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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:03:21+00:00 2026-06-15T16:03:21+00:00

In this code I’m building a method that adds the same image a number

  • 0

In this code I’m building a method that adds the same image a number of times to a Relative Layout at runtime. However, the images are not showing up when debugging. The textview that was added is acting normally. Can someone explain how to make the images visible? Thanks in advance.

My Code:

public class TestActivity extends Activity {
ArrayClass arraysObject1 = new ArrayClass();
ArrayList<ImageView> mImages = new ArrayList<ImageView>();

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        RelativeLayout layout = new RelativeLayout(this);

        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
        params.addRule(RelativeLayout.ALIGN_PARENT_LEFT, RelativeLayout.TRUE);
        layout.setLayoutParams(params);
        layout.setBackgroundColor(Color.parseColor("#FFFFFF"));

        //textview is working
        TextView testText = new TextView(this);
        testText.setText("Alle aangeboden vacatures vindt u hieronder terug.");
        testText.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
    layout.addView(testText);


        RelativeLayout.LayoutParams imgParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        imgParams.addRule(RelativeLayout.CENTER_IN_PARENT);

        for(int i=0; i<arraysObject1.array1.size(); i++)
        {
            mImages.add(new ImageView(this));
            mImages.get(i).setVisibility(View.VISIBLE);
            mImages.get(i).setBackgroundResource(R.drawable.work);
            mImages.get(i).setLayoutParams(imgParams);

            layout.addView(mImages.get(i));

        }
        setContentView(layout);
    }
}
  • 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-15T16:03:22+00:00Added an answer on June 15, 2026 at 4:03 pm

    Your cycle for(int i=0; i < arraysObject1.array1.size(); i++) seemed not to be executed.
    arraysObject1.array1 is empty.

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

Sidebar

Related Questions

This code is the core of a much larger script that works great in
This code below takes in an two digit number (let's say 12) in ASCII
this code works fine but my problem is that i need to read the
This code works as a is in the same scope where eval runs: function
This code: if (dt.Subtract(prevDt).TotalMinutes == 15) (dt and prevDt are DateTime vars that contain
This code create db backup file, but the file name have always the same
This code sometime throwing an Exception even i have used synchronized Method removeFirst within
This code below basically will count the number of occurrences of a word inside
This code below allows me to find the word error in all my files
This code disabled mouse scroll functionality, when i click on the document. $(document).on(click, function

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.