Note that there are some explanatory texts on larger screens.

plurals
  1. POSettingsActivity/Fragment is showing options out of the layout bounderies
    primarykey
    data
    text
    <p>I have created an PreferenceActivity with a PreferenceFragment in it. But the content with all the settings is shown outside of it layout bounderies, what am I doing wrong?</p> <p><img src="https://i.stack.imgur.com/IXoWu.png" alt="Settings"></p> <p>SettingsActivity:</p> <pre><code>public class SettingsActivity extends PreferenceActivity { @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); getFragmentManager().beginTransaction().replace(android.R.id.content, new MyPreferenceFragment()).commit(); } public static class MyPreferenceFragment extends PreferenceFragment { @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); } } } </code></pre> <p>preferences.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;PreferenceCategory android:title="My list of Preferences"&gt; &lt;CheckBoxPreference android:title="Checkbox Preference" android:defaultValue="false" android:summary="This preference can be true or false" android:key="checkboxPref" /&gt; &lt;EditTextPreference android:name="EditText Preference" android:summary="This allows you to enter a string" android:defaultValue="Nothing" android:title="Edit This Text" android:key="editTextPref" /&gt; &lt;RingtonePreference android:name="Ringtone Preference" android:summary="Select a ringtone" android:title="Ringtones" android:key="ringtonePref" /&gt; &lt;PreferenceScreen android:key="SecondPrefScreen" android:title="Secondary Level" android:summary="This is a sub PreferenceScreen"&gt; &lt;intent android:action="android.intent.action.VIEW" android:targetPackage="com.as400samplecode" android:targetClass="com.as400samplecode.Preferences2" /&gt; &lt;/PreferenceScreen&gt; &lt;Preference android:title="Custom Preference" android:summary="This works almost like a button" android:key="customPref" /&gt; &lt;/PreferenceCategory&gt; &lt;/PreferenceScreen&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload