I'm using a PreferenceFragment
and load the preference from xml in the onCreate-Method of the 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:
<?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 app on a GalaxyTab and now the preferences are not displayed correctly:
Here is a screenshot from my Galaxy S4:
and here is a screenshot from the GalaxyTab
As you can see, there is a strange frame or border in landscape-mode in the preference-view.
Any idea why that happens and how to solve this?
EDIT:
I've implemented a preferences subscreen in my preferences now and this is shown correctly:
If I press the up-Button to get to my main preferences page the strange frame/border is still there.
I'm afraid that will not help very much but here is an excerpt from my preferences xml with the subscreen:
<?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>