ExpandableListView
のビューがあり、ヘッダービューとして次のビューがあります。ExpandableListViewでどのボタンが押されたか
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="10">
<TextView
android:id="@+id/lblListHeader"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="30sp"
android:background="#ffa500"
android:layout_weight="2"/>
<Button android:layout_height="match_parent" android:layout_width="match_parent"
android:id="@+id/b1" android:layout_weight="8" android:text="text" android:background="#ffa500"
android:focusable="false" android:onClick="openChildDialog" />
</LinearLayout>
ボタンを押したときにメソッドopenChildDialog
が呼び出されています。ただし、リストヘッダの数に基づいてこのボタンのインスタンスが多数存在するため、どのボタンのインスタンスが押されているかをどのように知ることができますか?
EDIT:ここでの目的は、すべてのTextView
ので、押されたボタンに基づいて、Button
を持っている、ということですが、私はそれに対応するTextView
のテキストを取得したいです。
助けてください。前もって感謝します。
私は質問を編集しました。 –