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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:58:58+00:00 2026-06-13T02:58:58+00:00

What I have I have an open image dialog in an activity. This dialog

  • 0

What I have

I have an “open image dialog” in an activity. This “dialog” only shows folders and compatible images. For this I have a layer with a gridview that I fill with rows that contains an image and a text.

The text is for the name of the file and the image is for a preview of the image.

My problem

The dialog works well if the folder that I’m seeing doesn’t have lots of images. I’m working on a SII and when I try to open the camera album (photos of 8Mpx) it goes very slow with my code, even each time a new row is redrawed.

My code

I think the main problem resides in the creation of the preview images because if I delete this part all works fine. For the images, I have:

  @Override
public View getView(int position, View convertView, ViewGroup parent) {
   View grid;

   if(convertView==null){
       grid = new View(mContext);
       LayoutInflater inflater=getLayoutInflater();
       grid=inflater.inflate(R.layout.row, parent, false);
   }else{
       grid = (View)convertView;
   }

   ImageView icon = (ImageView)grid.findViewById(R.id.file_image);
   TextView label = (TextView)grid.findViewById(R.id.file_text);
   label.setText(item.get(position));
    if (item.get(position).equals("/")){
        icon.setImageResource(R.drawable.folderupup);
    }else if (item.get(position).endsWith("../")) {
        icon.setImageResource(R.drawable.folderup);
    }else if (item.get(position).endsWith("/")) {    
        icon.setImageResource(R.drawable.folder);
    }else{
        Bitmap b = BitmapFactory.decodeFile(path.get(position));
        Bitmap b2 = Bitmap.createScaledBitmap(b, 55, 55, false);
        icon.setImageBitmap(b2);
    }

   return grid;
  }
 }
  • 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-13T02:58:59+00:00Added an answer on June 13, 2026 at 2:58 am

    Finally I did all that the Android page said without doing anything for the cache. Now the list loads fast. Maybe I could add a memory cache as Wenhui pointed but it is so fast that it doesn’t matter for my purposes.

    The test has been done on a SII with a folder containing around 400 with 8Mpx

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

Sidebar

Related Questions

I have an image byte[] , this byte[] is coming from LDAP [Oracle Open
I have a open file dialog with three filters: QString fileName = QFileDialog::getOpenFileName( this,
I have a background image I am drawing with open gl 1.0 es. The
I have to open a page from class extended from javax.swing.AbstractAction class... Is that
I have an open-source iPhone API that I downloaded, and that is a standalone
I have a open source editor on the cms that I am making that
i have made a file open dialog, it contains an edit control whose variable
I have some error in my JavaScript which should open a dialog with an
Im trying to implement an activity that uses ExpandableListView and I have gotten so
This one should be easy, I think. I have a paginated image gallery, and

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.