Извините за мой английский.Этикетки пропусков (с идентификатором) не меняются при изменении конфигурации
У меня есть активность.
Схема деятельности:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/containerOfStandardFilters" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/containerOfMoreFilters" />
</LinearLayout>
</ScrollView>
В коде деятельности я динамически заполнить обе раскладки контейнеров. В настоящее время я заполняю только containerOfStandardFilters
.
Layout, который я использовал, чтобы раздуть содержание containerOfStandardFilters
:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="@dimen/textSizeOfFilterGroupTitle"
android:text="@string/titleOfSortingGroup" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/textSizeOfSortingGroupItems"
android:text="@string/labelOfSortByDistanceCheckBox"
android:id="@+id/sortByDistanceCheckBox" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/textSizeOfSortingGroupItems"
android:text="@string/labelOfSortByDiscountCheckBox"
android:id="@+id/sortByDiscountCheckBox" />
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/sizeBetweenFilterGroups" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="@dimen/textSizeOfFilterGroupTitle"
android:text="@string/titleOfPaymentMethodGroup"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/textSizeOfSortingGroupItems"
android:text="@string/labelOfCashlessPaymentsCheckBox"
android:id="@+id/cashlessPaymentsCheckBox" />
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/sizeBetweenFilterGroups" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="@dimen/textSizeOfFilterGroupTitle"
android:text="@string/titleOfWorkingHoursGroup"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/textSizeOfSortingGroupItems"
android:text="@string/labelOfWorksNowCheckBox"
android:id="@+id/worksNowCheckBox" />
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/sizeBetweenFilterGroups" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="@dimen/textSizeOfFilterGroupTitle"
android:text="@string/titleOfDiscountTypeGroup" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/textSizeOfSortingGroupItems"
android:text="@string/labelOfBonusCheckBox"
android:id="@+id/bonusCheckBox" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/textSizeOfSortingGroupItems"
android:text="@string/labelOfDiscountCheckBox"
android:id="@+id/discountCheckBox" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/textSizeOfSortingGroupItems"
android:text="@string/labelOfCashBackCheckBox"
android:id="@+id/cashBackCheckBox" />
</LinearLayout>
Но если изменить текущий язык (через настройки) и возвращается к активности фильтра (от активности системы настройки), то только вид без идентификатора будет обновляться этикетки.
Как я могу решить свою проблему?
Почему "-1" ???? ????? –
Значение значения с идентификатором сохраняется при изменении конфигурации. Также вы можете реализовать код с помощью фрагментов и добавить их в свой xml вместо макетов фреймов – vamsiampolu