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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:10:31+00:00 2026-06-12T04:10:31+00:00

I am trying to set certain items in my gridview from clickable to non

  • 0

I am trying to set certain items in my gridview from clickable to non clickable. So I have a gridview with a custom adapter on it and a onitemclicklistener. In my Custom adapter, I try to do the following in my getView method: (since I read about calling isEnabled..)

if(int value < 5) { //item can not be clickable
isEnabled(position);
} else {
//other things happen, but isEnabled is not called here in any case
}
//......
@Override
    public boolean isEnabled(int position) {

            return false;

    }

The strange thing is, now every item is not clickable, although there are items where the value is > 5.. I don’t know what is causing this…

  • 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-12T04:10:32+00:00Added an answer on June 12, 2026 at 4:10 am

    So what you’re actually doing here is overriding a built in method isEnabled(int) and telling it to always return false. This is causing your adapter to always tell your grid that its cells should not be enabled.

    What you’re actually looking for is something more like

    public boolean isEnabled(int position) 
    {
        if(position < 5)
            return false;
        else
            return true;
    }
    

    The key here is that you aren’t the one calling isEnabled. You’re overriding isEnabled, and the GridView is calling it automatically to determine which cells should be clickable and which should not. So you should never actually call isEnabled anywhere in your code for this purpose.

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

Sidebar

Related Questions

I have been trying to set the scroll of my page to a certain
Im trying to implement small project where people can set tags for certain items
I have a simple Twitter mockup set up following rails tutorial and I'm trying
Trying to set it so if a certain condition is met then one of
When trying to set DoMatchParen I get the following error: E492: Not an editor
I'm currently trying to bind to certain items in a collection in wpf. This
I'm trying to set a reminder in a system to fire at a certain
I'm trying to write a JavaScript tool to work on items of a certain
I have the following tables created: Table #1: tbl_Connections USE [taaraf_db] GO SET ANSI_NULLS
So what I am trying to do is to have a set UI 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.