0

Im creating a simple bucketlist app. I want to sort when a user clicks on the checkbox itself but if they click on the text next to the checkbox, I want to open up an edit activity. How can I have these two onclick events for one checkbox? I am using a recyclerview if that changes anything.

<LinearLayout
    android:layout_height="fill_parent"
    android:layout_width="wrap_content"
    android:id="@+id/linearLayout1"
    android:orientation="vertical"
    android:layout_weight="1"
    >
    <CheckBox
        android:text="Place_holder Name"
        android:id="@+id/bucket_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1">

    </CheckBox> </LinearLayout>
user4151797
  • 65
  • 2
  • 8
  • already answered here http://stackoverflow.com/questions/8184597/how-do-i-make-a-portion-of-a-checkboxs-text-clickable – Daniel Puiu Feb 02 '17 at 22:13

1 Answers1

1

I would remove the text from the checkbox and place a textview right next to it and put the text in the textview. This way you can easy distinguish between two types(on the checkbox and on the text) of clicks, because they would be clicks on different views.

Alex
  • 779
  • 7
  • 15