2016-09-02 4 views
0

방금 ​​API 24 (Android Nougat)를 지원하도록 앱을 업그레이드했습니다. 환경 설정 화면 (설정)이 있으며 Android Nougat를 제외한 지원되는 모든 Android 버전에서 잘 작동합니다. 버전에서는 모든 설정의 제목 및 요약이 표시되지 않습니다.Android nougat (7) 기본 설정 xml

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 :

<?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> 
다음

은 기본 활동 : 여기

은 XML이다. 여기

는 아이콘이 표시, 설정의 결과입니다 enter image description here

내가 SDK (23)와 함께 컴파일 내 응용 프로그램을 다운 그레이드하는 경우 , 그것은 어떤 문제없이 작동합니다.

의견이 있으십니까? 정확히 내가 누가 API 수준으로 업데이트 언제부터

감사합니다, Eliran

답변

0

내가 같은 문제에 봉착했습니다.

해결 방법으로 this을 사용했지만 setBackgroundColor (Color.BLACK)로 인해 테마 전환이 사용되는 경우 문제가 발생합니다. 코드가 API 23까지 제대로 작동했기 때문에 이것이 Android 7에 도입 된 버그 일 수 있다고 생각합니다.