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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:28:17+00:00 2026-06-04T06:28:17+00:00

I want to disable items in a ListView . First, I tried to use

  • 0

I want to disable items in a ListView.

First, I tried to use the method isEnabled() from my ArrayAdapter.

But this method is used to make a difference between seperators an normal list view items.

So I tried to disable my items by setting the OnClickListener and OnLongClickListener to NULL in the method getView() of my ArrayAdapter.

This works, but has no graphical effect to the disabled item.

Do I have to set the graphical effect by myself or are there better ways to disable an item in a ListView?

  • 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-04T06:28:18+00:00Added an answer on June 4, 2026 at 6:28 am

    OK, I found the solution for my question: List items are disabled by layout. Simply add android:clickable="true" (yes, true is right) to the root node of the layout. To add an graphical effect to the elements of the list item (e.g. TextViews), simply add android:enabled="false" to them. At last you have to inflate this “disabled” layout in your list view adapter. That’s all 🙂

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

Sidebar

Related Questions

I'm developing an Android 2.2 application with a ListView. I want to disable this:
I want to disable the Selector from my ListView . That's when I click
I want to disable some items in ListView which is in the AlertDialog .
I want to draw some listview items disabled and would like to mimic the
At the beginng of my app, i want to delete a few items from
Hi I want to disable some items of the textbox like Right to left
I am writting a code to disable selcted items in LISTBOX. i.e I want
How can i enable and disable android:singleLine dynamically?I have a listview, i want to
I have few grid items. Depending on the flag, I want to disable some
So i want to disable the window scrolling on mousedown+mousemove, i searched everywhere, but

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.