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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:58:18+00:00 2026-06-04T09:58:18+00:00

I am stuck at a point where my activity generates a list containing an

  • 0

I am stuck at a point where my activity generates a list containing an thumb image and name of all folders that contain images from SD card..
1. How do i filter only those folders with the images?
2. How do i get the thumb images from the first image in the folder?

  • 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-04T09:58:19+00:00Added an answer on June 4, 2026 at 9:58 am
    How do i filter only those folders with the images
    

    you can check the extension of the files in the folder to see if they’re of image type.

    How do i get the thumb images from the first image in the folder
    

    compress the file into smaller dimensions by using the following

    public Bitmap compressBitmap(String filePath, int requiredSize)
    {
        File file = new File(filePath);
        if (file.exists())
        {
            try
            {
    
                BitmapFactory.Options o = new BitmapFactory.Options();
                o.inJustDecodeBounds = true;
                BitmapFactory.decodeFile(filePath, o);
    
                // The new size we want to scale to
                final int REQUIRED_SIZE = requiredSize;
    
                // Find the correct scale value. It should be the power of 2.
                int width_tmp = o.outWidth, height_tmp = o.outHeight;
                int scale = 1;
                while (true)
                {
                    if (width_tmp / 2 < REQUIRED_SIZE || height_tmp / 2 < REQUIRED_SIZE)
                    {
                        break;
                    }
                    width_tmp /= 2;
                    height_tmp /= 2;
                    scale *= 2;
                }
    
                // Decode with inSampleSize
                BitmapFactory.Options o2 = new BitmapFactory.Options();
                o2.inSampleSize = scale;
                return BitmapFactory.decodeStream(new FileInputStream(file), null, o2);
            }
    
            catch (FileNotFoundException e)
            {
                e.printStackTrace();
            }
    
            return null;
        }
    
        return null;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am stuck at one point where I want to create a list of
I have a TabActivity that is the base Activity in my application. From the
I'm currently in a stagnant (stuck) point here. First of all, let me clearly
I am stuck at this point. Scenario is like that - I have already
i'm stuck at a point where i am using a wildcard parameter with the
I am stuck at a Local to Global Point issue in Objective C ViewController
I'm stuck at this method and I don't know why! Can anyone point me
I'm extremely new to Flex and I'm stuck at this early point. I have
I have a List<CustomObject> (where CustomObject comes from an external library -- I can't
I'm learning C++ by myself, creating a RPG. However, I'm stuck at point of

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.