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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:32:45+00:00 2026-06-05T21:32:45+00:00

I have a list. Each row includes an Image at left and two text

  • 0

I have a list. Each row includes an Image at left and two text views on right.
Based on server flag my application opens system media player or open another activity to show news detail.

In my adapter I want to add another image on top my video images (not news images). So, in XML file of Row I have another image View that its visibility is set to “Invisible” and I want to set it to “Visible” for each row which is video.

getView() method is like this:

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

            if (convertView == null) {
                convertView     = myInflater.inflate(R.layout.list_news_adapter, null);
                holder          = new ViewHolder();
                holder.ivIcon   = (ImageView)   convertView.findViewById(R.id.list_news_icon);
                holder.ivPlay   = (ImageView)   convertView.findViewById(R.id.list_news_PlayIcon);
                holder.tvTitle  = (TextView)    convertView.findViewById(R.id.list_news_title);
                holder.tvDate   = (TextView)    convertView.findViewById(R.id.list_news_date);

                convertView.setTag(holder);
            } else {
                holder = (ViewHolder) convertView.getTag();
            }

            holder.tvTitle.setText(mLatestNews.getTitle().get(position));
            holder.tvDate.setText(localTime.get(position));

            if(mLatestNews.getType().get(position).equalsIgnoreCase("VIDEO"))
                holder.ivPlay.setVisibility(View.VISIBLE);

            // Load and display image
            String imageUrl = (mLatestNews.getImageLink().get(position));
            imageUrl = imageUrl.trim().replaceAll(" ", "%20");
            imageLoader.displayImage(imageUrl, holder.ivIcon, options);

            return convertView;
    }

    static class ViewHolder {
        ImageView ivIcon;
        ImageView ivPlay;
        TextView tvTitle;
        TextView tvDate;
    }

Normally first four items of list are video and rest are news. When I run the appllication, not only 4 first items, even second image will be activated (set to visible) for some news items.

correct result is like this image:
enter image description here

but after scroll of list, second image (white triangle) adds to news items. like this image:
enter image description here

I have no idea why it happens. any suggestion would be appreciated.

  • 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-05T21:32:46+00:00Added an answer on June 5, 2026 at 9:32 pm

    Oh, my god!!!!

    It just needs “else”. I changed the code like this:

    if(mLatestNews.getType().get(position).equalsIgnoreCase("VIDEO"))
                    holder.ivPlay.setVisibility(View.VISIBLE);
                else
                    holder.ivPlay.setVisibility(View.INVISIBLE);
    

    Now, it’s working.

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

Sidebar

Related Questions

in my application I have a lit view. each row includes thumbnail image in
In my app I have a list with rows, each containing an image, text,
I want to have a list view with each row having two buttons like
I have a list view with 10 columns and I want each row to
I have a list, each row consisting of a main item and subitem. I
Let's say I have a list of primary keys, for each row one value
I have a table with multiple rows in each row is a select list
I have created a custom list view, each row has it's own custom selector,
I have a list view which contains a button in each row of the
I have a table that gets a dynamic source list for each row, with

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.