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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:26:42+00:00 2026-05-27T04:26:42+00:00

Currently my code displays a single image from a file path (in SDCard). This

  • 0

Currently my code displays a single image from a file path (in SDCard). This is in onCreate() method for now:

 ImageView imgView01 = (ImageView) findViewById(R.id.imageView1);  
 File dir = new File("/sdcard/WallpapersHD/");
 File file[]=dir.listFiles();
 for (int i=0;i<file.length;i++) {
      Drawable d = (Drawable) Drawable.createFromPath(file[i].toString());
      imgView01.setImageDrawable(d);
      }

I want to display all the images in that particular folder one after the other using a time delay of say 5 seconds. If I can create a new drawable for each image in the folder, How do I do it? and how do I change the image in ImageView to set that drawable’s path?

  • 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-27T04:26:42+00:00Added an answer on May 27, 2026 at 4:26 am

    You could use an ImageSwitcher for convenience, and then do:

        imageSwitcher.postDelayed(
                new Runnable() {
                    @Override
                    public void run() {
                        i++;
                        imageSwitcher.setImageURI(Uri.fromFile(file[i]));
                        imageSwitcher.postDelayed(this, millisBetweenImages);
                    }
                },
                millisBetweenImages);
    

    it also has a setImageDrawable-method if you want to keep your images as Drawables.

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

Sidebar

Related Questions

I have here this code. I want it to first display an image file
This code correctly fetches data, and displays it; however, the sort is completely ignroed.
The code currently does this and the fgetpos does handle files larger than 4GB
My code currently looks like this: private Foo myFoo; public Foo CurrentFoo { get
My code currently looks like this: <div style=position: fixed; width: 35.25%; height: 6.75%; left:
We currently have code like this: Dim xDoc = XDocument.Load(myXMLFilePath) The only way we
I am loading images from a single PostgreSQL database shared currently by my production
I currently use the following code to upload one file to a remote server:
I want to perform a printf() to display when the currently executing code was
Why does this code fail to display the category name Apples using the current

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.