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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:28:28+00:00 2026-06-01T06:28:28+00:00

I have a ListView set with a adapter. This adapter receive a list of

  • 0

I have a ListView set with a adapter.

This adapter receive a list of Objects.
In these Objects, there is an attribute isActivated.
If this attribute is false, I don’t want to display this item into the ListView but I don’t want to delete the Object from the list of Objects I pass through the Adapter.

I try to return a null from the getView() method of the Adapter but obviously it’s not that.

How could I do ?

ERROR:

questions04-01 12:21:54.290: E/AndroidRuntime(5593): FATAL EXCEPTION: main
questions04-01 12:21:54.290: E/AndroidRuntime(5593): java.lang.NullPointerException
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.ListView.fillDown(ListView.java:692)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.ListView.fillFromTop(ListView.java:750)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.ListView.layoutChildren(ListView.java:1629)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.AbsListView.onLayout(AbsListView.java:1993)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.View.layout(View.java:9606)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.ViewGroup.layout(ViewGroup.java:3879)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.LinearLayout.layoutVertical(LinearLayout.java:1403)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.LinearLayout.onLayout(LinearLayout.java:1314)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.View.layout(View.java:9606)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.ViewGroup.layout(ViewGroup.java:3879)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1527)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.LinearLayout.onLayout(LinearLayout.java:1316)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.View.layout(View.java:9606)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.ViewGroup.layout(ViewGroup.java:3879)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.LinearLayout.layoutVertical(LinearLayout.java:1403)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.LinearLayout.onLayout(LinearLayout.java:1314)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.View.layout(View.java:9606)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.ViewGroup.layout(ViewGroup.java:3879)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.FrameLayout.onLayout(FrameLayout.java:400)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.View.layout(View.java:9606)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.ViewGroup.layout(ViewGroup.java:3879)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.LinearLayout.setChildFrame(LinearLayout.java:1542)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.LinearLayout.layoutVertical(LinearLayout.java:1403)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.LinearLayout.onLayout(LinearLayout.java:1314)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.View.layout(View.java:9606)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.ViewGroup.layout(ViewGroup.java:3879)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.widget.FrameLayout.onLayout(FrameLayout.java:400)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.View.layout(View.java:9606)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.ViewGroup.layout(ViewGroup.java:3879)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.ViewRoot.performTraversals(ViewRoot.java:1288)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.view.ViewRoot.handleMessage(ViewRoot.java:2066)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.os.Handler.dispatchMessage(Handler.java:99)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.os.Looper.loop(Looper.java:132)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat android.app.ActivityThread.main(ActivityThread.java:4126)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat java.lang.reflect.Method.invokeNative(Native Method)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat java.lang.reflect.Method.invoke(Method.java:491)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
questions04-01 12:21:54.290: E/AndroidRuntime(5593): questionsat dalvik.system.NativeStart.main(Native Method)
  • 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-01T06:28:30+00:00Added an answer on June 1, 2026 at 6:28 am

    There will be a view for each object in the adapter. Therefore you want that view to be invisible when !isActivated, not null. Try making getView() return whatever type of views your rows are, with height zero.

    It seems very hackish and unless your adapter has thousands of items, you should nonetheless filter the list before creating it.

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

Sidebar

Related Questions

I have a ListView control on my form set up like this in details
I have an empty TextView set for my ListView . When there is no
In my Android application, I have a simple list view with adapter. There's a
I want to know when my listview has no adapter set on it. I
I have a ListView in my ListActivity which is inflated with an adapter. There
I have Vector of elements that i set into BaseAdapter subclass and this adapter
I have a ListView which has been constructed, styled and had an adapter set
I have a ListView control set up in details mode with 5 columns. It
I have a ListView that is set up with a MinHeight and a MaxHeight.
I have a listview of width set to Auto. When I run the windows

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.