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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:09:51+00:00 2026-06-06T15:09:51+00:00

Below is my code for setting up a listview. I want to implement a

  • 0

Below is my code for setting up a listview. I want to implement a click event on the listview, but it is not working. I have set the clickable attribute for the listview in the manifest. Also my listview is located inside a relative layout, and this relative layout is located in a linear layout. My list_details has the textview and imageview in a relative layout. Could you please help me in figuring this out. Thanks in advance.

public class ListImageBaseAdapter extends BaseAdapter {
...

public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
    if (convertView == null) {
        convertView = l_Inflater.inflate(R.layout.list_details, null);
        holder = new ViewHolder();
        holder.txt_itemName = (TextView) convertView.findViewById(R.id.name);
        holder.itemImage = (ImageView) convertView.findViewById(R.id.photo);

        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }

        System.out.println(titles.length);

        holder.txt_itemName.setText(titles[position]);
        holder.itemImage.setImageResource(imgid[position]);

            holder.itemImage.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            System.out.println("here1");
        }
    });

    holder.txt_itemName.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            System.out.println("here2");
        }
    });


    return convertView;
}
...
  • 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-06T15:09:52+00:00Added an answer on June 6, 2026 at 3:09 pm
     I want to implement a click event on the listview, but it is not working. 
    

    check two things

    1- have you implemt list click this way ?

     list.setOnItemClickListener(new OnItemClickListener() {
                    @Override
                    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                            // @todo
                    }
            }); 
    

    2- is there any clickable item in list row
    if yes then refer

    Android: ListView elements with multiple clickable buttons

    http://mylifewithandroid.blogspot.in/2011/08/focus-problems-with-list-rows-and.html

    for handling the click on item in row :

    1- Imaplent you activity with View.OnClickListener
    2- Pass it to adpter 
    3- holder.itemImage.setOnClickListener(mActivity)
    4- override the View.OnClickListener in activity 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below code only showing the textfield, but I want to include textfield and textarea.
Below code is working but why ? Where does the x and y coming/saved
Below code makes form to be submitted without html5 validation... $j(document).on(click, #client_entry_add, function(event){ ajax_submit();});
I have the code below adding a movie clip to my stage and setting
I am using c# and jQuery. I have below code where I am setting
I have a problem with core data when setting relationships: The code below crashes
I am setting background color of an li element by the code below :
I'm having trouble setting a custom back button. Below is the current code I'm
Below code is for donwnloading file from azure blob. I have problem with .docx,.xlsx
Below code checks for last item but I need to check for the second

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.