Preference is not displayed correctly on the tablet

I use PreferenceFragmentand load preference from xml in onCreate-Method PreferenceFragment:

     @Override
     public void onCreate(Bundle savedInstanceState) 
     {
      ...
      addPreferencesFromResource(R.xml.preferences_base);
      PreferenceManager.setDefaultValues(getActivity(), R.xml.preferences_base, false);  
      ...
     }

This is an excerpt from the preference_base.xml file:

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
        <CheckBoxPreference
            android:key="boolStartSettings"
            android:title="@string/prefBoolStartSettings"
            android:summary="@string/prefBoolStartSettingsSummary"
            android:defaultValue="false"/>

...

</PreferenceScreen>

This works fine and, as expected, in the simulator and on my Galaxy S4. Today I tested the application on GalaxyTab, and now the settings are not displayed correctly:

Here is a screenshot from my Galaxy S4: enter image description here

and here is a screenshot from GalaxyTab enter image description here

As you can see, in preference mode in landscape mode there is a strange frame or frame.

Any idea why this is happening and how to solve it?


EDIT:

In my preferences, I have now changed the settings sub-screen, and this is shown correctly: enter image description here

If I press the button up to go to my main settings page, the weird frame / border is still there.

, , xml :

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
        xmlns:android="http://schemas.android.com/apk/res/android">
<!-- not shown correctly -->
...    
    <PreferenceCategory
            android:title="@string/prefKatEffectsAndAnimations">
            <PreferenceScreen
                android:key="@string/keyPrefDetails"
                android:title="@string/prefCmdDetailSettings"
                android:persistent="true">
                    <!-- shown correctly -->
                    ...
            </PreferenceScreen>
    </PreferenceCategory>
...
</PreferenceScreen>
+3
1

, Activity, PreferenceActivity. , " addPreferencesFromResource " PreferenceActivity?

+4

All Articles