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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:16:30+00:00 2026-05-16T00:16:30+00:00

I have a little problem. I have class private static class EfficientAdapter extends BaseAdapter

  • 0

I have a little problem. I have class

private static class EfficientAdapter extends BaseAdapter {
        private LayoutInflater mInflater;

        public EfficientAdapter(Context context) {

            mInflater = LayoutInflater.from(context);
        }

        // return size of elements
        public int getCount() {
            return BridgeJSON.listFromJSON.getItem().size();

        }

        public Object getItem(int position) {
            return position;
        }

        public long getItemId(int position) {
            return position;
        }

        public View getView(int position, View convertView, ViewGroup parent) {
            ViewHolder holder;
            if (convertView == null) {
                position_move = 0;

                convertView = mInflater.inflate(R.layout.row, null);

                holder = new ViewHolder();

                holder.txt_description = (TextView) convertView
                        .findViewById(R.id.description_event);

                ......

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


            if (listFromJSON.getItem().get(position).isViewed() == false) {


                convertView.setBackgroundColor(Color.RED);

                this.notifyDataSetChanged();




            } else {

                // get text for description
                String txt_for_description = listFromJSON.getItem().get(
                        position - position_move).getDescr();

                ..........
            }

            return convertView;
        }

        static class ViewHolder {
            TextView txt_description;
            TextView txt_time;
            TextView txt_title;
            TextView txt_place;
        }
    }

When I do that, method convertView.setBackgroundColor(Color.RED) work great, what I need
Image is there:
dl.dropbox.com/u/866867/stack/device2.png

but when I want to remove that item, I can’t do it. I add there convertView.setVisibility(View.GONE); , but have empty item, beside hide it. I read that parameter View.INVISIBLE won’t hide layout, but View.GONE have, but in my code, doesn’t(((

And that image:
http://dl.dropbox.com/u/866867/stack/device.png

  • 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-16T00:16:30+00:00Added an answer on May 16, 2026 at 12:16 am

    With adapters, when you want to remove an item, you generally use mAdapter.remove(theObjectToRemove);
    and then, you update your ListView :
    mListView.notifyDataSetChanged();
    However, in your case, you have a BaseAdapter which does not have this method. so can you use an ArrayAdapter instead of BaseAdapter with your set of data?

    Or you would have to recreate your baseAdapter after removing what you want to remove from your array.

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

Sidebar

Related Questions

Hi all im using a sqlite helper class, but i have a little problem
I have a little problem with a class I am currently writing a save
I have a custom dialog inside public class NewPartnerDialog extends Dialog implements OnClickListener And
I have little problem with a replacement of a little part in an url.
I have little problem in regular expressin creation. Expected input: blahblahblah, blahblahblah, 'blahblahblah', blahblahblah,
I have little unusual problem to solve. I need some hint or links to
I have a little problem about the sort direction of a specific column in
I have a little problem with Jquery getJSON function. my json here { entries:
I have a little Problem with the app that I'm developing. In the App
I have a little problem. This is my code: stackPanelShapesContainer = new StackPanel(); InitializeStackPanle();

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.