2

Ok, after figuring out the earlier question 'Layout Question', now my OnItemClickListener, and ItemLongClickListener(ContextMenu) have stopped working. With just the TextView it works fine

xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout  
  xmlns:android="http://schemas.android.com/apk/res/android" 
  android:layout_width="fill_parent" 
  android:layout_height="wrap_content">

    <TextView 
      android:id="@+id/txtVehName" 
      android:hint="@string/VEH_NAME" 
      android:textSize="18dp" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content"
      android:layout_marginTop="10dip"
      android:layout_alignParentBottom="true"
      > 
    </TextView>

    <RadioButton 
      android:id="@+id/rbDefault" 
      android:text="" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:layout_alignParentBottom="true"
      > 
    </RadioButton> 

</RelativeLayout>

Anyone have any ideas as to why this would stop working?

thanks

lopez.mikhael
  • 9,943
  • 19
  • 67
  • 110
bugzy
  • 7,086
  • 9
  • 42
  • 44
  • I'm thinking this has something to do with the fact that the RadioButton is editable/Clickable? – bugzy Jan 19 '10 at 22:47
  • 1
    Please check this question: http://stackoverflow.com/questions/5374011/adding-checkbox-to-list-row-loses-my-onitemclick-events – Gerrit Schimpf Jan 15 '13 at 09:56

1 Answers1

0

Add these lines to your RadioButton Layout:

android:focusable="false"
android:focusableInTouchMode="false"

This will prevent the button from taking focus, therefore making the OnItemClickListener work

Goldorak84
  • 3,714
  • 3
  • 38
  • 62