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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:54:56+00:00 2026-05-24T18:54:56+00:00

In my android project I am Using a custom listview to show information. In

  • 0

In my android project I am Using a custom listview to show information. In each element of the listview(Each row in list view) have several clickable forcussable textviews. And I added lstvw.setItemsCanFocus(true), for listview and now i can select any clickable textview and click.

----------------
textviewclick1
textviewclick2
----------------
textviewclick1
textviewclick2
----------------
continue......

But can’t figure out how exactly handle the onClick event for each clickable textview as getView() method in the BaseAdapter class is bit confusing for me.

I implemented onclickListener in the ListviewAdapter class that I extended BaseAdapter and created.

public class ListVWAdapter extends BaseAdapter implements OnClickListener{ implementation...}

can anyone suggest me how to handle onClick(View view) method to handle all the clickable textview items.
I tried following way but did’t work correct. I globally declared the ViewHolder viewholder since I want to access it in this method rather than declaring it in normal way within the getView() method. But initializing normal way by checking if (convertView == null)

@Override
public void onClick(View v) {

    if(v==holder.txtViewTitle)
        Toast.makeText(v.getContext(), "Link1 : "+ String.valueOf(currentPosition), Toast.LENGTH_LONG).show();

    if(v==holder.txtViewDescription)
        Toast.makeText(v.getContext(), "Link2 : "+ String.valueOf(currentPosition), Toast.LENGTH_LONG).show();

}
  • 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-24T18:54:57+00:00Added an answer on May 24, 2026 at 6:54 pm

    In list item xml, for <TextView..> set android:onClick="onFirstLinkClick". Similarly for second TextView.
    Then in activity class implement this

    public void onFirstLinkClick(View V) {
        // handle click
    }
    

    Similarly another method for second textview. That should work.

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

Sidebar

Related Questions

I have a few custom views in my Android project and I've added the
I made an android project using eclipse. It looks like: src/ ActivityMain.java lib/ Square.java
I am making for my Graduation Project a low price Navigation device, using Android
I have a Android project for SDK1.5 and now I want to convert it
I have an Android project that branched into three different applications, app-1 , app-2
I created an Android project a few months ago and now have to automate
I have an Android project and Eclipse is telling me my project has an
I am making an sqlight using eclipse outside the android project what should I
I have an Android project that contains a class that uses JNI to pull
I'm using eclipse, and I have two android projects which have different topics. And

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.