【发布时间】:2017-05-22 10:38:57
【问题描述】:
我有一个带有 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 被调用。但是,由于根据列表标题的数量会有很多此按钮的实例,我如何知道按下的是哪个按钮实例?
编辑:这里的目的是,由于每个TextView 都有一个Button,根据按下的按钮,我想获取其对应的TextView 的文本。
请帮忙。提前致谢。
【问题讨论】:
标签: android button expandablelistview