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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:38:41+00:00 2026-06-07T07:38:41+00:00

I have a checkable item in my list view public class CheckableMessageOut extends RelativeLayout

  • 0

I have a checkable item in my list view

public class CheckableMessageOut extends RelativeLayout implements Checkable{
    public CheckableMessageOut(Context context) {
        super(context);
    }

    public CheckableMessageOut(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    LinearLayout wrapper;
    private boolean checked = false;

    @Override
    public void setChecked(boolean b) {
        if (checked!=b){
            if (b){
                wrapper.setBackgroundResource(R.drawable.label_msg_out_selected);
            } else {
                wrapper.setBackgroundResource(R.drawable.label_msg_out);
            }
        }
        checked = b;
    }

I use it like this

<ru.kurganec.vk.messenger.ui.helper.CheckableMessageOut xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"

        >
    <LinearLayout
            android:id="@+id/wrapper"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:background="@drawable/label_msg_out"
            android:orientation="vertical">
        <TextView
                android:id="@+id/text_msg"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"

                android:text="ad"

                />
        <LinearLayout
                android:id="@+id/list_attach"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:orientation="vertical">
        </LinearLayout>
    </LinearLayout>

    <TextView
            android:id="@+id/text_date"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toLeftOf="@id/wrapper"

            android:text="06.06"/>

</ru.kurganec.

vk.messenger.ui.helper.CheckableMessageOut>

sometimes i add some views programmatically to the @id/list_attach and then something strage happens. I cannot select the item with attached view.

Whole It looks like this.

Message with photo cannot be selected but others(without photos) can be selected

by saying selected i mean checked.
I set this field mList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

Why can’t i select the itemss?


UPDATE

Fragment class http://pastebin.com/BZRhahbi this is the main part of my app , so it looks like “god class” antipattern

Adapter class http://pastebin.com/Av7ntUmG

Adapter’s item class http://pastebin.com/MdYc7Ksw

  • 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-07T07:38:43+00:00Added an answer on June 7, 2026 at 7:38 am

    I solved the problem

    Just add this to root view, if you have clickable views in ListView

     android:descendantFocusability="blocksDescendants"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application i have a listView. each item of the list view contains
I have a custom list view and I want the background of the list
i have a listView with a custom BaseAdapter.Every list item has a clickable button.
I have a listview where each list item can contain 1 or more clickable
I have the following ClickListener: itemList=(ListView)findViewById(android.R.id.list); itemList.setTextFilterEnabled(true); itemList.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?>
I have created a list view within a tab with a list of teams
I was wondering if it were at all possible to have checkable icons in
On an Android View, I want to have a some clickable text that works
I have been having problems creating a relative layout in XML for a list
I have a drawable state list selector that needs to display a different drawable

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.