私は、カスタムアダプタを持つカスタムListViewをArrayAdapterに拡張しています。私はRelativeLayoutビューを取得していますonListItemClick ListActivity方法でCustom ListActivityとinsideListのonListItemClick
<?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="?android:attr/listPreferredItemHeight">
<TextView android:id="@+id/filePickerTextView1"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:minHeight="?android:attr/listPreferredItemHeight"
android:focusable="true" android:text="item" />
<ImageView android:layout_width="wrap_content"
android:focusable="true" android:src="@drawable/icon"
android:layout_height="fill_parent" android:id="@+id/filePickerImageView1"
android:layout_alignParentRight="true" android:layout_alignRight="@android:id/text1"></ImageView>
</RelativeLayout>
: ArrayAdapter 2つのビューでXMLを膨らませています。私が必要とするのは、正確なビューがクリックされたことを知ることです(TextViewまたはImageView)。私はリスナーを設定することでこれをアダプターで得ることができますが、私はListActivityでそれを必要とします。理由は、クリックしたビューに基づいてsetResultを発生させる必要があるからです。
私は疑問に言ったように、私はListActivityではなく、アダプターでそれを必要とします。 ListActivityとアダプタ間でデータを交換する可能性はありますか? – korro
アダプタからのリストアのデータを設定できます –