다음과 같은 문제가 있습니다. Android 앱에서 테이블을 사용하여 정보를 표시하고 있습니다. 이 정보는 체크 박스로 표시되는 2 개의 부울 값도 포함합니다. 테이블이로드되면 체크 상자는 정상적으로 작동하지만 인터페이스 방향을 변경하자마자 데이터 값이 false 인 경우에도 두 확인란이 모두 선택됩니다.Android - 이상한 체크 박스 동작
테이블은 다음과 같이 정의된다 :
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/table_properties"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffffff"
/>
그리고 테이블 단일 불리언 행 모든 세트
<TableRow
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/text_jobprop_name"
style="@style/text_list_black"
android:layout_height="fill_parent"
android:textSize="12dp"
android:padding="3dp"
android:singleLine="false"
android:gravity="center_vertical"
android:background="@color/table_property_name_background"
android:layout_weight="0.7"
android:layout_width="0dp"
/>
<LinearLayout
android:layout_height="wrap_content"
android:gravity="left"
android:layout_marginRight="5dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:layout_width="0dp"
android:background="@color/white">
<CheckBox
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/chckbox_jobprop_value"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:clickable="false"
android:layout_marginLeft="10dp"
/>
</LinearLayout>
</TableRow>
그리고 함수 호출하는 활동에서 onCreate 방법을 테이블에 대한 값. 이 함수는 인터페이스 방향을 변경할 때마다 호출된다는 것을 알고 있지만 디버깅하고 데이터 값은 변경되지 않습니다.
힌트, 아이디어 등은 무엇입니까?
감사합니다.
감사합니다, 효과가있었습니다. – Pathos
천 가지 고마워요, 이것도 저를 위해 해결되었습니다 :) 나는 onRestoreInstanceState가 잘 작동하는 다른 곳을 듣습니다. 아직도 - 이상한 행동과 찾기가 어렵다 : / – Groxx