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

  • Home
  • SEARCH
  • 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 8911639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:59:52+00:00 2026-06-15T03:59:52+00:00

I’m geting really confused here. I filled my ArrayAdapter once on activity creation. Its

  • 0

I’m geting really confused here. I filled my ArrayAdapter once on activity creation.
Its filled with simple objects. Among the object’s parametrs there is one boolean which I use on getView() method of adapter. This is the concerning part:

MedicalExamination object = getItem(position); //object is acquired at the begining of getView()

if (!object.isResultAvalible()) 
  viewHolder.attachment.setVisibility(View.GONE);

When i scroll the list up and down several times, resultAvalible boolean starts changing (?!). No other information on the object changes, I hold couple of strings there which I display on TextViews in my list cell. List stays as it was… besides this boolean params which changes and makes my ImageView (attachment) dissapear.

My bollean param is private, there is no even a set method for it. Only way its beeing set is in constructor.

I have no clue what is happening, please need some help on that.

My custom adapter code due to requests:

private class ExaminationsAdapter extends ArrayAdapter<MedicalExamination> {
    private int resource;

    public ExaminationsAdapter(Context context,
            List<MedicalExamination> objects) {
        super(context, R.layout.examinations_list_item, objects);
        resource = R.layout.examinations_list_item;
    }

    class ViewHolder {
        public TextView examinationsNames;
        public TextView date;
        public ImageView attachment;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = convertView;
        ViewHolder viewHolder;
        MedicalExamination object = getItem(position);

        if (view == null) {
            LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            view = inflater.inflate(resource, null, true);
            viewHolder = new ViewHolder();
            viewHolder.examinationsNames = (TextView) view.findViewById(R.id.examinations_item_title);
            viewHolder.date = (TextView) view.findViewById(R.id.examinations_item_date);
            viewHolder.attachment = (ImageView) view.findViewById(R.id.examinations_item_attachment);

            view.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) view.getTag();
        }

        if (object == null) {
            return view;
        }

        viewHolder.examinationsNames.setText(object.getExaminationsNames());
        viewHolder.date.setText(object.getDate());

        if (!object.isResultAvalible()) 
            viewHolder.attachment.setVisibility(View.GONE);

        setOnListTouchListener(view);
        return view;
    }
}
  • 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-15T03:59:53+00:00Added an answer on June 15, 2026 at 3:59 am

    You need to take in consideration that you could have a recycled view on your hands(one for which the view may be hidden from where this row was used), so:

    if (!object.isResultAvalible()) {
        viewHolder.attachment.setVisibility(View.GONE);
    } else {
        // revert the image status to the default
        viewHolder.attachment.setVisibility(View.VISIBLE);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string

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.