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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:19:32+00:00 2026-05-25T01:19:32+00:00

im novice to android.For displaying random images i used arraylist. ArrayList<Integer> List = new

  • 0

im novice to android.For displaying random images i used arraylist.

ArrayList<Integer> List = new ArrayList<Integer>();
        for(int i=0;i<10;i++) 
        { 
            List.add(i);
            System.out.println("Random Images"+List.add(i));
        }
        Collections.shuffle(List);

        for(int i=0;i<10;i++){
            imageArr[i] = (ImageView)findViewById(id[List.get(i)]);
            System.out.println("Display Images"+List.get(i));
        }
    }

it is running correctly in logcat but what should do to display images on emulator screen. Pls Suggest

  • 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-25T01:19:33+00:00Added an answer on May 25, 2026 at 1:19 am

    You will need an ImageView to display Images on the Screen.
    You can display drawable, bitmaps, …
    The easiest way to do this create your main.xml like this:

    <ImageView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/myImageView" />
    

    Then call in your code (maybe in the onCreate):

    ImageView imgView = (ImageView)  findViewById(R.id.myImageView);
    

    Then make a Drawable Array or an ArryList with bitmaps, whatever.
    Get a Random value (like Math.random()) and fetch a random image from array or arraylist like

    Drawable drawable = drawableArray[YOURRANDOMNUMBER];
    

    and set the Drawable to the imageview.

    imgView .setImageDrawable(drawable);
    

    Hope this helps 🙂

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

Sidebar

Related Questions

I'm a novice Android developer. I used the code given at Google's Android developer
I'm a novice Android programmer, and to help me understand how Intents really work,
I am developing an Android application. I am novice in Touch enabled Android Application.
I need your help to add some insight into JNI on Android. I've been
Just my a new Android phone and I've been tinkering with some basic apps.
I am an android novice and have been experimenting with SQLite and Android. I
I am novice in android development and facing some problems. I have installed Eclipse
I am novice in android platform & I'd like to use Bengali as language
I'm novice in android. I'm writing an android application which requires the data like
I am a novice to android and java development. Currently, I got a small

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.