Очень быстро, у меня есть listView с пользовательским адаптером, и он надувает представление, которое содержит HorizontalScrollView, а также просмотр текста и т. Д. У меня проблема в том, что когда я пытаюсь присоединить слушателя к этому listView, это не так.получение любых обратных вызовов.
Я полагаю, что проблема связана с тем фактом, что мой элемент списка содержит представление прокрутки, которое перехватывает события щелчка (хотя я думал, что оно должно только перехватывать другие жесты).
код ... (мой список элементов xml)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearMain"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey" >
<TextView
android:id="@+id/headerName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:padding="4dp"
android:textColor="@color/text_header"
android:textStyle="bold"
android:text="TextView" />
</RelativeLayout>
<View
android:background="@color/border"
android:layout_width="fill_parent"
android:layout_height="1px" />
<HorizontalScrollView
android:id="@+id/horizontalScrollView1"
android:layout_width="fill_parent"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/linearImages"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:padding="4dp">
</LinearLayout>
</HorizontalScrollView>
<View
android:background="@color/border"
android:layout_width="fill_parent"
android:layout_height="1px" />
</LinearLayout>
, а затем в моем onCreate ...
lv.setAdapter(myobj.adapter);
lv.setTextFilterEnabled(true);
lv.setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
Log.w("dsdsds", "sdsdsds");
}});
Любая помощь или предложения будут с благодарностью