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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:27:35+00:00 2026-06-13T11:27:35+00:00

I am using a listview layout in a descendant of Activity, the Adapter’s getView

  • 0

I am using a listview layout in a descendant of Activity, the Adapter’s getView implementation is as follow, it’s longclickable:

public View getView(int position, View convertView, ViewGroup parent) {
    if (convertView == null) {
        TextView tv = new TextView(CustomTitleActivity.this);
        tv.setText(title[position]);
        return tv;
    }
    return convertView;
}

but when I tried inflate the item’s view from a layout file like this:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/local_songs_list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:focusable="false"
    android:orientation="horizontal">
    <LinearLayout
        android:layout_weight="1"
        android:focusable="false"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
        <TextView
            android:id="@+id/title"
            android:layout_height="wrap_content"
            android:layout_width="fill_parent"
            android:focusable="false"
            android:text="TITLE"
            android:textAppearance="?android:textAppearanceSearchResultTitle"
            />
        <TextView
            android:id="@+id/artist"
            android:layout_height="wrap_content"
            android:layout_width="fill_parent"
            android:text="Unknow"
            android:focusable="false"
            android:textAppearance="?android:textAppearanceSearchResultSubtitle"
            />      
    </LinearLayout>

    <LinearLayout
        android:layout_weight="3"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
            android:focusable="false"
        android:orientation="horizontal">
        <ImageButton 
        android:id="@+id/favorite"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_favourite"
            android:background="#0000"
            android:focusable="false"
            android:onClick="onToggleStar"/>

        <CheckBox 
        android:id="@+id/select"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="visible"
            android:focusable="false"/>
    </LinearLayout>
</LinearLayout>

I could not click/long click them, I already tried to set android:focusable attribute to false.
Could someone give me a hint?

  • 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-13T11:27:36+00:00Added an answer on June 13, 2026 at 11:27 am

    Answer it myself.
    Because in constructor of ImageButton, it would call setFocusable(true) again, so if you really don’t need it to be focused, it’s ok to call setFocusable(false) after the ImageButton was constructed. Then the problem solved.

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

Sidebar

Related Questions

I'm using the following code to use a ListView in CustomAlertDialog Layout . public
Im using listview in my listview activity with listAdapter like this: setListAdapter(new ArrayAdapter<MyItem>(this,R.layout.catalog, R.id.label,
I'm implementing an Android activity. I am using a ListView in my application layout,
I'm using a ListView that is setup like this: <ListView android:id=@android:id/list android:layout_width=fill_parent android:layout_height=fill_parent android:longClickable=false
I am building an app using listview and lazy adapter based on @fedor post
I'm using a custom listview I found here: http://developer.android.com/resources/samples/ApiDemos/res/layout/linear_layout_9.html Seems to be valid in
I am trying to create a ListView using the following code: setListAdapter(new ArrayAdapter<String>(this, R.layout.settings_items,
I have a question about the implementation of a ListView layout within a tab
I make List view with image and text using simple adapter in android. But
I'm using android listview and its working perfectly fine. my implementation as below ListView

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.