0
확장 가능 목록의 상위보기에 단추를 추가하려고합니다. 이것은 부모보기에 대한 내 레이아웃입니다.확장 가능 목록의 상위보기에 단추가 필요합니다
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/explist_indicator"
android:layout_width="25dp"
android:layout_height="match_parent"
android:layout_weight=".25"
android:src="@drawable/expander_group" />
<TextView
android:id="@+id/contacts"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:paddingLeft="20dp"
android:text="@string/contacts"
android:textSize="28dp" >
</TextView>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:background="@drawable/plus"
android:text="Button" />
</LinearLayout>
정상적으로 자바 클래스에 버튼을 추가하지만 리스너를 추가하려고하면 null 포인터 예외가 발생합니다. 이 버튼을 추가하여 특정 부모의 모든 하위 항목을 선택/선택 취소합니다. 어떤 도움이라도 좋을 것입니다.
일부 코드와 LogCat을 게시해야합니다. – kaspermoerch