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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:29:43+00:00 2026-06-12T03:29:43+00:00

I want to create a listview where each element has several imageview, but they

  • 0

I want to create a listview where each element has several imageview, but they will never be shown together; they will be shown according to the data they want to describe.
This is a part of the element layout

<ImageView
    style="@style/release_item_resolution_pic"
    android:id="@+id/release_res_standard"
    android:layout_alignLeft="@+id/release_label_title"
    android:src="@drawable/format_standard" />

<ImageView
    style="@style/release_item_resolution_pic"
    android:id="@+id/release_res_720p"
    android:layout_toRightOf="@+id/release_res_standard"
    android:src="@drawable/format_720p" />

<ImageView
    style="@style/release_item_resolution_pic"
    android:id="@+id/release_res_webdl"
    android:layout_toRightOf="@+id/release_res_720p"
    android:src="@drawable/format_webdl" />

<ImageView
    style="@style/release_item_resolution_pic"
    android:id="@+id/release_res_dvdrip"
    android:layout_toRightOf="@+id/release_res_webdl"
    android:src="@drawable/format_dvdrip" />

Keep in mind that every element has its visibility set to “gone”.
To set which picture show I use this loop, into the getView() method:

            for(VideoFormat format:selectedRel.getResolutions()){
            ImageView resolutionPic=getResolutionImageView(format, contentView);
            resolutionPic.setVisibility(View.VISIBLE);
        }

and it works fine, except when I scroll the list and then get back to the first elements. It looks like the list loads other pictures, even if it’s not supposed to; after some times the uncesessary pictures disappear, but it takes too much time. What can I do to avoid all this, and always get the right picture visible?
EDIT:
This is the getResolutionImageView method:

private ImageView getResolutionImageView(VideoFormat format, View contentView){
        switch(format){
        case BDRIP:
            return (ImageView)contentView.findViewById(R.id.release_res_bdrip);

        case BLURAY:
            return (ImageView)contentView.findViewById(R.id.release_res_bd);

        case DVDRIP:
            return (ImageView)contentView.findViewById(R.id.release_res_dvdrip);

        case HD_1080i:
            return (ImageView)contentView.findViewById(R.id.release_res_1080i);

        case HD_1080p:
            return (ImageView)contentView.findViewById(R.id.release_res_1080p);

        case HD_720p:
            return (ImageView)contentView.findViewById(R.id.release_res_720p);

        default:
            return (ImageView)contentView.findViewById(R.id.release_res_standard);

        case WEB_DL:
            return (ImageView)contentView.findViewById(R.id.release_res_webdl);

        }
    }
  • 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-12T03:29:44+00:00Added an answer on June 12, 2026 at 3:29 am

    When list view scrolls it’s getView method called. But the convertView which it gets may contains old data. (data of other list rows).

    So here is the solution

    in getView method when you set the Visibility of one image, set Invisible of all other ImageViews.

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

Sidebar

Related Questions

I want to create a ListView that contains Each item has an id and
I want to create a listview which contains webview on each row.Webviews are added
I want to create a listview that immediately when initialized in the onCreate() method
ASP.Net 3.5 I want to create a user control that contains the ListView and
I want to create an informative app that will display a list of content.
I have a ListView where I want each item to have an ID number
Hey, I want to know how do I do to create a ListView in
I want to create an interface that has one or two listviews that ultimately
I created a listview that has a custom SimpleCursorAdapter. I want to place a
I'm trying to create a simple ListView. the items shown on the ListView are

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.