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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:04:19+00:00 2026-06-14T18:04:19+00:00

I have the following layout as an item layout in my ListView . How

  • 0

I have the following layout as an item layout in my ListView. How to handle the first ImageView click which has iv_info as ID?

Do I have to use both onItemClick and onClick or anything else?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/bg_list_row_9patch"
    android:orientation="horizontal"
    android:padding="@dimen/fifteen_dp" >

    <ImageView
        android:id="@+id/iv_info"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_weight="@dimen/exercise_list_row_iv_weight"
        android:contentDescription="@string/help"
        android:src="@drawable/btn_info" />

    <TextView
        android:id="@+id/erl_tv_exsercise_name"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_weight="@dimen/exercise_list_row_tv_weight"
        android:paddingLeft="@dimen/ten_dp"
        android:textColor="@android:color/white"
        android:textSize="@dimen/list_row_text_size"
        android:textStyle="bold" >
    </TextView>

    <TextView
        android:id="@+id/erl_tv_participant_name"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_weight="@dimen/exercise_list_row_tv_weight"
        android:gravity="right"
        android:textColor="@android:color/white"
        android:textSize="@dimen/list_row_text_size" >
    </TextView>

    <ImageView
        android:id="@+id/iv_exercise_status"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_weight="@dimen/exercise_list_row_iv_weight"
        android:src="@drawable/btn_info" />

</LinearLayout>
  • 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-14T18:04:20+00:00Added an answer on June 14, 2026 at 6:04 pm

    in adapter’s getView method, get the image view and set onClickListener..

    Example:

    public View getView(int position, View convertView, ViewGroup parent) {
        View vi=convertView;
        ViewHolder holder;
        if(convertView==null){
            vi = inflater.inflate(R.layout.item, null);
            holder=new ViewHolder();
            holder.text=(TextView)vi.findViewById(R.id.text);;
            holder.image=(ImageView)vi.findViewById(R.id.image);
            vi.setTag(holder);
        }
        else
            holder=(ViewHolder)vi.getTag();
    
        holder.text.setText("item "+position);
        holder.image.setTag(data.get(position));
        holder.image.setOnClickListener(this);
        holder.text.setOnClickListener(this);
        imageLoader.DisplayImage(data.get(position), activity, holder.image);
        return vi;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following ClickListener on my ListView. My item layout is a RelativeLayout
I have following situation: I have a custom ListView with ImageView and TextView in
I have the following problem. On my layout I have an action bar (which
I have one listview that compiles layout template, item template and insert item template.
I created a custom ListView. Each item in the list have one imageView and
I have the following application layout: Activity with a LinearLayout hosting a Fragment, which
I have an activity in Android which uses a ListView. When I click on
I have to make another highlight color for ListView item. I use custom adapter
I have the following code to intantiate a SimpleCursorAdapter to use with a ListView.
I have a ListView in my layout. Here is the layout for list item.

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.