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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:15:35+00:00 2026-06-16T07:15:35+00:00

I am reading files from the selected folder on my phone like you can

  • 0

I am reading files from the selected folder on my phone like you can see in the following code.
And how could I get this work with an Imagefile?
At the end I like to have an imagelist with a preview of every image.
Like that:

[IMG] (imgview) – [Filename] (String)

        for(int i=0; i < files.length; i++) {

        File file = files[i];
            map = new HashMap<String, String>();
        if(!file.isHidden() && file.canRead()) {
            path.add(file.getPath());

            if(file.isDirectory()) {
                map.put("img_list", ""+R.drawable.folder);
                map.put("string_cell", file.getName()+"/");
                your_array_list.add(map);

            }else{


                ImageFileFilter filefilter = new ImageFileFilter(file);

                if(filefilter.accept(file)){
                   //Its an imagefile

                    // ==> I like to replace the ""+R.drawable.image with the file that I have read
                    map.put("img_list", ""+R.drawable.image);


                } else {

                    //Its not an image file

                }

                map.put("string_cell", file.getName());
                your_array_list.add(map);

            }
        } 


    }

        SimpleAdapter mSchedule = new SimpleAdapter(this, your_array_list, R.layout.connected_upload_row,
            new String[] {"img_list", "string_cell"}, new int[] {R.id.img_list, R.id.string_cell});
list.setAdapter(mSchedule);

In the following picture I like to replace the white “image” picture with the original picture called “41786486733.jpg” as preview.
So that the user can see what picture this is…

enter image description here

EDIT FLORIAN PILZ

if(filefilter.accept(file)){

                    Log.v("PATH1", file.getPath() );


                    ImageView myImageView = (ImageView) findViewById(R.id.img_list);
                    Bitmap bmp = BitmapFactory.decodeFile(file.getAbsolutePath());
                    myImageView.setImageBitmap(bmp); 



                }

enter image description here

  • 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-16T07:15:36+00:00Added an answer on June 16, 2026 at 7:15 am

    the solution for my problem is here:

    How to show thumbnail from image path?

    I had to create a customlistview (with help from ρяσѕρєя K) THANKS!!

    create an custom adapter by extended baseadapter class instead of SimpleAdapter . as i think this will be easy or also you can create more custom UI instead of using inbuild

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

Sidebar

Related Questions

I have the code below, which simply reads all the files from a folder.
I've been reading json files from my content folder using the asset manager to
I am reading HTML files from a folder using xml parser that store the
Why does reading from __DATA__ work and reading from the file doesn't (Loose unescaped
When reading an NSString from a file I can use initWithContentsOfFile:usedEncoding:error: and it will
I'm having some trouble reading files with Indy from a site that has WordPress
I am reading several files from linux /proc fs and I will have to
i am using the following multiselect box to take input from users, this then
reading excel files from C# working well in 32 bit version server. It is
I'm reading some files from the procfs every few seconds, and displaying the information.

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.