0

I looked at several tutorials and all their listPreference dialogs look like this.

listPreference Dialog

but my dialog looks like this

my dialog

Any ideas why my dialog looks different? I reviewed the tutorials and my xml code looks the same as theirs.

Here is my pref_general.xml code.

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

  <!-- NOTE: EditTextPreference accepts EditText attributes. -->
<!-- NOTE: EditTextPreference's summary should be set to its value by the activity code. -->
<EditTextPreference
    android:key="@string/pref_location_key"
    android:title="@string/pref_title_location"
    android:defaultValue="@string/pref_location_default"
    android:selectAllOnFocus="true"
    android:inputType="text"
    android:capitalize="words"
    android:singleLine="true"
    android:maxLines="1" />

<!-- NOTE: ListPreference's summary should be set to its value by the activity code. -->
<ListPreference
    android:title="@string/pref_temperature_units_title"
    android:key="@string/pref_temperature_units_key"
    android:defaultValue="@string/pref_units_metric"
    android:entryValues="@array/pref_temperature_unit_values"
    android:entries="@array/pref_temperature_units"
    />

and part of the activity code

public class SettingsActivity extends PreferenceActivity
    implements Preference.OnPreferenceChangeListener {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Add 'general' preferences, defined in the XML file
    addPreferencesFromResource(R.xml.pref_general);

    // For all preferences, attach an OnPreferenceChangeListener so the UI summary can be
    // updated when the preference changes.
    bindPreferenceSummaryToValue(findPreference(getString(R.string.pref_location_key)));
    bindPreferenceSummaryToValue(findPreference(getString(R.string.pref_temperature_units_key)));

}
luismbedder
  • 1
  • 1
  • 2

1 Answers1

0

I think you are testing in lollipop device. if you test below lollipop devices, it will look like first one.You can customize it like this 'How to customize list preference radio button'

Community
  • 1
  • 1
Srikanth
  • 1,555
  • 12
  • 20