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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:33:26+00:00 2026-05-26T04:33:26+00:00

I have read about problems that onClickListener will consume onItemClickListener Events like here or

  • 0

I have read about problems that onClickListener will consume onItemClickListener Events like here or here. My Problem is exactly the other way:

I have a CustomAdapter extends ArrayAdapter where I place model Objects to generate a row. In My Activity i registered an onItemClickListener like so

//items can focus false to try to get the onItemClick-event
mListView.setItemsCanFocus(false);
mListView.setOnItemClickListener(this);
mListView.setAdapter(this.favoritePointAdapter);

then in my Adapter.getView() Method I inflate my layout get my ImageView and register an OnClickListener on it like this

@Override 
public View getView(int position, View convertView, ViewGroup parent){
    //....inflate other Views.....
    LinearLayout clickArea = (LinearLayout)convertView.findViewById(R.id.list_row_favorite_point_click_area);
    clickArea.setOnClickListener(this);

   //... other logic follows ...
}

at least i Try to fetch this Events in my Adapter like this

@Override
public void onClick(View v) {
    Log.d("ListAdapter", "onClick triggered");
            //never triggered
    switch (v.getId()) {
    case R.id.list_row_favorite_point_click_area:
        Log.d("ListAdapter", "onClick id->list_row_favorite_point_click_area");
        //never triggered
        break;

    default:
        break;
    }
}

If you find xml of RowView interesting, here it is:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/list_row_relative_parent"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="horizontal" 
  android:focusable="false">
  <LinearLayout
    android:id="@+id/list_row_icon"
    android:layout_width="30dip"
    android:layout_height="30dip"
    android:layout_gravity="center_vertical"
    android:layout_margin="3dip"
    />
 <LinearLayout
   android:layout_weight="50"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:orientation="vertical"
   android:layout_gravity="center_vertical">   
   <TextView
     android:id="@+id/list_row_name"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:textColor="#333333"
     android:text="defaultText"
     android:textStyle="bold" />         
   <TextView
     android:id="@+id/list_row_region"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:textColor="#999999"
     android:textStyle="italic"
     android:text="Region" />
   </LinearLayout>

   <LinearLayout 
     android:id="@+id/list_row_favorite_point_click_area"
     android:layout_width="50dip"
     android:layout_height="50dip">

   <ImageView
     android:id="@+id/list_row_favorite_icon"
     android:layout_width="20dip"
     android:layout_height="20dip"
     android:layout_gravity="center_vertical"
     android:layout_weight="0.1">
   </ImageView>
   </LinearLayout>
 </LinearLayout>

As I said, The ListView’s onItemClick of My Activity gets triggered while I never reach onClick inside my Adapter. I think that onItemClick ‘feels’ responsible for the whole row and consumes TouchEvents. What can I do to work around it?

Note: I tried setItemsCanFocus(false) and focusable in my root to false, too, as mentioned in the other questions.

  • 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-26T04:33:26+00:00Added an answer on May 26, 2026 at 4:33 am

    Rather than using an onClickListener, I’d suggest using the onTouchListener.

    Check out this tutorial, which I have used before to get the “swipe screens” in an application:
    http://www.warriorpoint.com/blog/2009/05/29/android-switching-screens-by-dragging-over-the-touch-screen/

    Also, see the android dev docs on the onTouchListener:
    http://developer.android.com/reference/android/view/View.OnTouchListener.html

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

Sidebar

Related Questions

From what I have read about extension methods, you will run into problems if
I have read about a lot of people having problems with the browser not
I have read all threads about this without finding any answer to my problem.
I have read all the other user's accounts of problems, but they don't seem
I have recently read about how cursors should be avoided. Well, I would like
I have read the other posts about the notorious _imaging C module error when
I have read about this function didReceiveMemoryWarning that actually hasn't really helped. I would
I have read more than 3 questions here in stackoverflow about this, but all
I have read and learned a lot here, got a lot of problems solved
I have read about continuency parser and dependency parser. but confused which could be

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.