Indented Android PreferenceFragment



I'm not exactly sure why this is happening, but when I create my preferences fragment. All of the preferences in a preference category are indented. When I do this in a smaller app, the settings appear just fine. Any ideas?


Screen Shot



public class SettingsFragment extends PreferenceFragment {


public SettingsFragment() {
// Required empty public constructor
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.fragment_settings);
}


}



<?xml version="1.0" encoding="utf-8"?>



<PreferenceCategory android:title="Game Setup">

<CheckBoxPreference
android:key="checkbox_randomize_opponents"
android:title="Randomize Opponents"
android:summary="Randomize opponents after round 1" />

</PreferenceCategory>



int id = item.getItemId();
switch (id) {

case R.id.action_settings:

Fragment f = getFragmentManager().findFragmentByTag("settings_frag");

if (f == null)
f = new SettingsFragment();

getFragmentManager().beginTransaction().addToBackStack("settings").replace(android.R.id.content, f, "settings_frag").commit();
return true;

No comments:

Post a Comment