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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:40:10+00:00 2026-06-02T15:40:10+00:00

I have a simple row model and a ListView in a Fragment; the ListView

  • 0

I have a simple row model and a ListView in a Fragment; the ListView gets properly populated, with all the correct dimensions, colors, etc. Problem is, clicking on a row fires no event.

The code in my fragment is:

MyAdapter mAdapter = new MyAdapter(getActivity().getApplicationContext(), R.layout.list_row, strings);
mList.setAdapter(mAdapter);

mList.setOnItemClickListener(new OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        Log.d("LIST", "Selected item # " + position);
    }
}); 

The fragment layout (a piece of it) is:

<ListView
    android:id="@+id/m_list"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:layout_margin="20dp"
    android:clickable="true"
    android:longClickable="true">
</ListView>

The row layout is:

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_height="wrap_content"
android:layout_width="match_parent">

    <TextView
        android:id="@+id/txt_surname"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_weight="1"
        android:text="@string/surname"
        style="@style/ListStyleXLarge"/>

    <!-- 4 more TextView just as the first one -->
</LinearLayout>

The style is simply:

    <style name="ListStyleXLarge">
    <item name="android:textSize">
        @dimen/text_size_large
    </item>
    <item name="android:textStyle">
        bold
    </item>
    <item name="android:textColor">
        @color/list_item_text_color
    </item>
</style>

What can fix this problem? I have already tried to set the

android:clickable="false"
android:focuseable="false"
android:focuseableInTouchMode="false"

to all of the TextViews, but nothing so far.

  • 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-02T15:40:12+00:00Added an answer on June 2, 2026 at 3:40 pm

    In your MyAdapter class:

    In the getView method use:

    convertView.setOnClickListener(new OnClickListener() {
    
                @Override
                public void onClick(View v) {
                    // TODO Auto-generated method stub
    
                    Log.d("LIST", "Selected item # " + position);
    
                }
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple bit of jQuery which displays the row below the current
I'm trying to have a simple html table, that highlights a row as a
I have a fairly simple question: how to take one row of cv::Mat and
I have a struct called Point. Point is pretty simple: struct Point { Row
i have simple regular expression: ^123$ Matches are for example 123 1234 etc. How
I have a simple model which is just a chain of one-to-many relationships: Country
I have a Model containing many rows. One of the columns in the row
I've have this DB Model http://www.dropmocks.com/mBgqjs and I'm using CakePHP to build a simple
I have a simple model like class Interest < ActiveRecord::Base has_and_belongs_to_many :user_profiles end class
I have two simple Model classes and a ViewModel... public class GridItem { public

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.