I'm writing an application. It needs to run on old android OS's to be useful. I have written the preferences screen using a PreferencesActivity that populates with a options.xml file that contains PreferenceScreen. It has no submenu for preferences (so PreferenceFragment provides no real benefits).
In Android 2.1 (2.2 and 2.3, haven't tested on ICS yet) the screen displays properly like so in landscape:
But on Jellybean, it looks like this:
It looks terrible. I have nothing defined as a layout, just standard addPreferencesFromResource(). Does anyone know what the cause of this might be? Or a solution?
My onCreate looks like this:
protected void onCreate(Bundle savedInstanceState) { //
super.onCreate(savedInstanceState);
Log.i(TAG, "Options Activity Loaded.");
setTitle(getString(R.string.optionsTitle));
addPreferencesFromResource(R.xml.options);
setupListeners();
}
Everything else just makes Preference objects and assigns methods to do stuff when they get clicked. I don't want to make code for both PreferenceFragment and PreferenceActivity. I do not understand how google expects us to use Fragment APIs if the largest version marketshare doesn't have that API and they will not add it to the compatibility lib.