0
私はAPI 24(Android Nougat)をサポートするようにアプリをアップグレードしました 私は設定画面(設定)を持っていて、Android Nougat以外のすべてのサポートされているAndroidバージョンすべての設定のタイトルとサマリーは表示されません。ここでAndroid nougat(7)preference xml
はXMLである:ここでは
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:fragment="com.jerby.MyApp.ui.fragments.MyApp_PreferenceFragment"
android:key="@string/settings_RootPreference"
android:persistent="true">
<MultiSelectListPreference
android:defaultValue="@array/empty_array"
android:icon="@drawable/ic_action_globe"
android:key="@string/settings_selected_languages_key"
android:order="10"
android:title="@string/settings_language" />
<PreferenceScreen
android:icon="@drawable/ic_action_phone_start"
android:key="@string/settings_behaviorCategory_PreferenceScreeen_key"
android:order="20"
android:persistent="true"
android:title="@string/settings_behaviorCategory_Title">
<CheckBoxPreference
android:defaultValue="false"
android:icon="@drawable/ic_action_phone_outgoing"
android:key="@string/settings_callImmediattly_Key"
android:order="10"
android:summary="@string/settings_CallImediatly_Summary"
android:title="@string/settings_CallImediatly_Title" />
<ListPreference
android:defaultValue="5000"
android:dependency="@string/settings_callImmediattly_Key"
android:entries="@array/TimerNumOfSec_Name"
android:entryValues="@array/TimerNumOfSec_Value"
android:icon="@drawable/ic_action_clock"
android:key="@string/settings_timerDelay_Key"
android:order="20"
android:title="@string/settings_timerDelay_Title" />
<CheckBoxPreference
android:defaultValue="false"
android:icon="@drawable/ic_action_goal_filled"
android:key="@string/settings_getExactName_Key"
android:order="30"
android:summary="@string/settings_getExactName_Summary"
android:title="@string/settings_getExactName_Title" />
<CheckBoxPreference
android:defaultValue="false"
android:icon="@drawable/ic_action_io"
android:key="@string/settings_AutoShutDown_Key"
android:order="40"
android:summary="@string/settings_AutoShutDown_Summary"
android:title="@string/settings_AutoShutDown_Title" />
</PreferenceScreen>
<PreferenceScreen
android:icon="@drawable/ic_action_monitor"
android:key="@string/settings_category_view"
android:order="30"
android:title="@string/settings_categoryTitle_ViewOptions">
<ListPreference
android:defaultValue="0"
android:entries="@array/DisplayLanguage_Name"
android:entryValues="@array/DisplayLanguage_Value"
android:icon="@drawable/ic_action_translate"
android:key="@string/settings_DisplayLanguage_Key"
android:order="50"
android:title="@string/settings_DisplayLanguage_Title" />
<CheckBoxPreference
android:defaultValue="true"
android:icon="@drawable/ic_action_star_0"
android:key="@string/settings_showFavorites_Key"
android:order="100"
android:summary="@string/settings_showFavorites_Summary"
android:title="@string/settings_showFavorites_Title" />
<ListPreference
android:defaultValue="2"
android:entries="@array/DisplayOrder_Name"
android:entryValues="@array/DisplayOrder_Value"
android:icon="@drawable/ic_action_sort_1"
android:key="@string/settings_DisplayOrder_Key"
android:order="200"
android:title="@string/settings_OrderBy_Title" />
<CheckBoxPreference
android:defaultValue="true"
android:icon="@drawable/ic_action_news"
android:key="@string/settings_ShowChangeLog_Key"
android:order="300"
android:summary="@string/settings_showChangeLog_Summary"
android:title="@string/settings_showChangeLog_Title" />
</PreferenceScreen>
<PreferenceScreen
android:icon="@drawable/ic_action_volume"
android:key="@string/settings_VoiceCategory_PreferenceScreeen_key"
android:order="35"
android:persistent="true"
android:title="@string/settings_VoiceCategory_Title">
<CheckBoxPreference
android:defaultValue="false"
android:icon="@drawable/ic_action_volume_up"
android:key="@string/settings_VoiceIndication_Key"
android:order="50"
android:summary="@string/settings_VoiceIndication_Summary"
android:title="@string/settings_VoiceIndication_Title"
android:visibility="invisible" />
</PreferenceScreen>
<PreferenceScreen
android:icon="@drawable/ic_action_bluetooth"
android:key="@string/settings_BluetoothCategory_Key"
android:order="40"
android:summary="@string/AvailableInFullVersion"
android:title="@string/settings_BluetoothCategory_Title">
<CheckBoxPreference
android:defaultValue="true"
android:icon="@drawable/ic_action_headphones"
android:key="@string/settings_BluetoothSupport_Key"
android:order="10"
android:summary="@string/settings_BluetoothSupport_Summary"
android:title="@string/settings_BluetoothSupport_Title" />
<CheckBoxPreference
android:defaultValue="true"
android:icon="@drawable/ic_action_mic"
android:key="@string/settings_BluetoothAutoLaunchRecognition_Key"
android:order="20"
android:summary="@string/settings_BluetoothAutoLaunchRecognition_Summary"
android:title="@string/settings_BluetoothAutoLaunchRecognition_Title" />
</PreferenceScreen>
<Preference
android:icon="@drawable/ic_action_movie"
android:key="@string/settings_Demo_Key"
android:order="50"
android:title="@string/settings_Demo_Title" />
<Preference
android:icon="@drawable/ic_action_document"
android:key="@string/settings_ChangeLog_Key"
android:order="60"
android:title="@string/settings_ChangeLog_Title" />
<Preference
android:icon="@drawable/ic_action_info"
android:key="@string/settings_About_Key"
android:order="70"
android:summary="summary"
android:title="@string/settings_About_Title" />
<PreferenceScreen
android:key="@string/settings_Debug_Screen_Key"
android:order="80"
android:persistent="true"
android:title="Debug">
<ListPreference
android:defaultValue="he"
android:entries="@array/Debug_Locale_Name"
android:entryValues="@array/Debug_Locale_Name"
android:key="@string/settings_Debug_Locale_Key"
android:order="10"
android:title="LOCALE" />
<CheckBoxPreference
android:key="@string/settings_Debug_IsLicensed_Key"
android:order="20"
android:title="Licensed" />
</PreferenceScreen>
は好みの活動である:
public class MyApp_PreferenceActivity extends PreferenceActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getFragmentManager().beginTransaction().replace(android.R.id.content,
new MyApp_PreferenceFragment()).commit();
ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(false);
}
}
}
、すべての値を保持しているMyApp_PreferenceFragment。ここで
私はSDK 23でコンパイルする私のアプリをダウングレードした場合、それはどんな問題なく動作します。
提案がありますか?
よろしく、 Eliran