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

  • Home
  • SEARCH
  • 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 7000423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:40:08+00:00 2026-05-27T20:40:08+00:00

Possible Duplicate: how can I show selection of an image in grid view at

  • 0

Possible Duplicate:
how can I show selection of an image in grid view at once

I have a question that I want a check mark image shows when we select an image from grid view in the middle of the image, means suppose when we click on a grid item then a check mark image will appear in the middle of the image which shows the selection of image.

For Example below are showing the iphone screen:

enter image description here

  • 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-27T20:40:09+00:00Added an answer on May 27, 2026 at 8:40 pm

    I was able to get the position of the clicked image by making the position final and adding an onClick listener to the imageView. This logs the position of the image that was clicked.

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
      ImageView imageView;
      if (convertView == null) {  
        // if it's not recycled, initialize some attributes
        imageView = new ImageView(mContext);
        imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        imageView.setPadding(8, 8, 8, 8);
    
    
        imageView.setOnClickListener(new View.OnClickListener() {
    
          @Override
          public void onClick(View view) {
            Log.d("onClick","position ["+position+"]");
          }
    
        });
    
      } 
      else {
        imageView = (ImageView) convertView;
      }
    
      imageView.setImageResource(mThumbIds[position]);
      return imageView;
    }
    

    or use this :
    For a GridView you can use the setOnItemClickListener method to have an OnItemClickListener listener. That listener will give you a method that you must override with the signature

    onItemClick(AdapterView<?> parent, View v, int position, long id)
    

    where you get the position of the item in the grid that was clicked and the View that is inside the cell of the grid. Is that what you need?

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

Sidebar

Related Questions

Possible Duplicate: Android: ProgressDialog.show() crashes with getApplicationContext I want to have a progress dialog
Possible Duplicate: Can we solve the table row background image problem, in chrome, in
Possible Duplicate: Can I retrieve an ipad unique device identifier that through Safari with
Possible Duplicate: Can we post image on twitter using twitter API in Android? I
Possible Duplicate: Can you have multiple $(document).ready(function() sections? Is it OK to have multiple
Possible Duplicate: Can Read-Only Properties be Implemented in Pure JavaScript? I have an Object
Possible Duplicate: Can anybody suggest the best image resize script in php? I'm still
Possible Duplicate: How to write a:hover in inline CSS? Can someone show me an
Possible Duplicate: Show line number in exception handling Can someone please tell me how
Possible Duplicate: What are the internal and external databases that can be used 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.