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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:29:05+00:00 2026-06-13T06:29:05+00:00

I’m having a problem with an android activity that extends ListActivity . It seems

  • 0

I’m having a problem with an android activity that extends ListActivity. It seems like the items in the list cannot be “clicked” until after I’ve scrolled the list. After you scroll the list a little, the “clicking” works fine. If the list simply is not scrollable (not enough items, etc) then everything works as it.

Since the activity extends ListActivity I just override onListItemClick:

@Override
protected void onListItemClick(ListView l, View v, int position, long id)
{
   Log.e(TAG, "Click fired");
}

The rows in the list are defined by a custom XML, and after reading through virtually all of the posts on here I’m thinking it has to do with focusable elements, but I can’t seem to get it to work. As you can see from the list XML below, all the items have focusable="false", but that didn’t help.

I’ve also tried all the options for android:descentFocusability — but none work properly.

This problem is apparent on all versions of Android from Froyo –> ICS

Edit

I have determined that this problem goes away if I remove the onScroll listener that is attached to the same list. However, I really need that and I’ve put logging info inside both onScroll and onScrollStateChanged and nothing informative shows up (e.g., scrolling isn’t being fired either.) Is this a known conflict?

Layout XML for activity in question:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:focusable="false"
    android:focusableInTouchMode="false">
   <FrameLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:focusable="false"
        android:focusableInTouchMode="false">
     <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Search Results: "
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:layout_gravity="left" 
            android:focusable="false"
            android:focusableInTouchMode="false" />
         <TextView android:id="@+id/query_type"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="context sensitive"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:layout_gravity="right" 
            android:textStyle="italic"
            android:focusable="false"
        android:focusableInTouchMode="false" />
       </FrameLayout>
       <FrameLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:minHeight="1dip"
        android:background='@color/grey'
        android:focusable="false"
        android:focusableInTouchMode="false" />
<ListView
    android:id="@+id/android:list"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:cacheColorHint="#00000000"
    android:descendantFocusability="blocksDescendants" />
<TextView
    android:id="@+id/prodcutdb_results_empty"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:paddingLeft="5dip"
    android:paddingTop='4dip'
    android:text="No results"
    android:focusable="false"
    android:focusableInTouchMode="false"
    android:visibility="gone"/>
</LinearLayout>

Custom list item XML: (adding focusable tags to the LinearLayout in this XML has no effect)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    android:orientation="horizontal"
    android:paddingRight="4dip"
    android:cacheColorHint="#00000000">
<TextView 
    android:id="@+id/list_item_label"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dp"
    android:paddingLeft="20dip"
    android:textSize="16dp" 
    android:layout_weight="1"
    android:clickable="false"
    android:focusable="false"
    android:focusableInTouchMode="false" />
    <view  
        android:layout_width="wrap_content"
        android:id="@+id/list_item_image"
        android:layout_height="fill_parent"
        android:src="@drawable/right"
        android:maxHeight="50dp"
        android:maxWidth="50dp"
        android:layout_gravity="right"
        android:clickable="false"
        android:focusable="false"
        android:focusableInTouchMode="false" />

</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-13T06:29:07+00:00Added an answer on June 13, 2026 at 6:29 am

    To keep things short — nothing worked. I added an onClick listener to each one of the custom views.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a small JavaScript validation script that validates inputs based on Regex. I
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I am trying to render a haml file in a javascript response like so:

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.