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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:38:54+00:00 2026-06-12T14:38:54+00:00

Basically, I would like to implement a GridView wherein the items themselves are clickable,

  • 0

Basically, I would like to implement a GridView wherein the items themselves are clickable, but within the GridView are clickable Buttons and Checkboxes.

Here’s a sample layout:

Gridview
-----------------------------------------
|[ImageView]        |[ImageView]        |
|[TextView]         |[TextView]         |
|[Button][Checkbox] |[Button][Checkbox] |
-----------------------------------------
|[ImageView]        |[ImageView]        |
|[TextView]         |[TextView]         |
|[Button][Checkbox] |[Button][Checkbox] |
-----------------------------------------

Basically, what i want to do is, when the user clicks the CheckBox, multiple items can now be selected from the GridView. When the users clicks the Button, A Popup is shown. When the user clicks anywhere else, a new Activity is started. The whole point of this is instead of long-pressing to show the context menu, I would like a button to take its place.

Any suggestions on how I can approach this scenario? In my current setup, if I add the Button within the adapter’s GetView() method, only the Button is clickable. The whole GridView item is not clickable. When I remove the Button, the GridView item is clickable again. It seems that it’s only the whole GridView Item or the Button is clickable (responds to OnClickListener(). Is there a way to make them both clickable?

  • 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-12T14:38:56+00:00Added an answer on June 12, 2026 at 2:38 pm

    This post is old, but just for reference/googlers, I have the following solution:

    You need to write all the events for buttons, checkboxes in getView of the imageAdapter only.
    Then in your layout.xml file under the gridview tag add these lines:

    android:clickable="true"
    android:descendantFocusability="beforeDescendants"
    

    and add these lines to your button and checkboxes:

    android:focusable="false"
    android:focusableInTouchMode="false"
    

    And if you want some other activity to start if any other area of the gridview item is clicked/touched you would need to use the (standard code)/(your own matching implementation):

    GridView gridview = (GridView) findViewById(R.id.gridview);
        gridview.setAdapter(new ImageAdapter(this));
    
        gridview.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
                Toast.makeText(HelloGridView.this, "" + position, Toast.LENGTH_SHORT).show();
            }
    

    Cheers,
    });

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

Sidebar

Related Questions

Having another tough one here guys, basically I would like to check if a
I would like to implement captcha when registering to XMPP server. Basically I have
Basically I would like some help on how to implement my idea. Any direction
What I basically would like to do is cp -Rl dir1 dir2 . But
Hello I would like to implement pull to refresh in my Android App. But
Basically I would like to store the address of a pointer in a buffer.
Basically I would like to tell MSTest to execute a bit of code before
I would like to basically get all the events that i get invited to
I would like to create a custom data type which basically behaves like an
I would like to set a variable in bash called test_var Basically, I want

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.