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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:06:29+00:00 2026-05-29T20:06:29+00:00

I have a file selector (which works as needed) but I wanted to add

  • 0

I have a file selector (which works as needed) but I wanted to add thumbnails to the list when appropriate. It works well enough for the first few images but then random file (and folder) items which are not images and should not have thumbnails take on random images that have already loaded. The whole list of of files eventually takes an image after repeated scrolling.

Is this a known issue with list views? Is there a standard way of showing thumbnails? Is my code just broken?

Below is the code the assigns the filenames and thumbnails to each list item – the class extends the ArrayAdapter.

public View getView(int position, View convertView, ViewGroup parent)
{
    View v = convertView;
    if (v == null)
    {
        LayoutInflater vi = (LayoutInflater) c
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        v = vi.inflate(id, null);
    }
    final Option o = items.get(position);
    if (o != null)
    {
        TextView t1 = (TextView) v.findViewById(R.id.TextView01);
        TextView t2 = (TextView) v.findViewById(R.id.TextView02);
        ImageView img1 = (ImageView) v.findViewById(R.id.imageView1);
        try
        {
            if(o.getData()!="Folder" && (o.getPath().contains(".jpg") || o.getPath().contains(".gif") || o.getPath().contains(".png")))
                img1.setImageBitmap(getPreview(o.getPath()));
        }
        catch (Exception e)
        {
            Log.w("Image failed in File Viewer", e);
        }
        if (t1 != null)
            t1.setText(o.getName());
        if (t2 != null)
            t2.setText(o.getData());

    }
    return v;
}
  • 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-29T20:06:30+00:00Added an answer on May 29, 2026 at 8:06 pm

    The problem is that you are reusing your views (which is the correct way). So when you start scrolling it will reuse the views that were displayed before. So all you have to do is reset the image/texts in your views when you’re not setting them.

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

Sidebar

Related Questions

So I already rolled my own custom logging function, which works quite well. But
I have code which works fine $('#' + file.id + 'tdp').remove(); $('#' + file.id
In my main CSS file, I have my a:link selector set to display links
Suppose I have file which goes like this : a void measure() { a
Say I have file A, in middle of which have a tag string #INSERT_HERE#.
I have a html file which select images from user's computer.code is given bellow
I have following code which works fine, however when I updated to Lion I
I have a file called function.js which has all my jQuery for my aplication
I have a problem with a TableRow, which I add dynamically. private void addRow(String
I have an xml file with a selector in it that defines the different

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.