M
muck
Ambitioniertes Mitglied
Hallo zusammen,
ich möchte in den Settings unter android:summary die aktuelle Einsetllung anzeigen. Und ich weiß nicht wie ich da ran komm. Wahrscheinlich ziemlich einfach aber ich sehe es im Moment nicht.
Mein Layout
Im Voraus vielen Dank.
Gruß
ich möchte in den Settings unter android:summary die aktuelle Einsetllung anzeigen. Und ich weiß nicht wie ich da ran komm. Wahrscheinlich ziemlich einfach aber ich sehe es im Moment nicht.
Mein Layout
Code:
<PreferenceScreenxmlns:android="[URL]http://schemas.android.com/apk/res/android[/URL]">
<PreferenceCategoryandroid:title="@string/app_settings">
<ListPreference
android:id="@+id/lpListRotation"
android:key="list_rotation"
android:defaultValue="@string/txt_rotation_default"
android:title="@string/txt_rotation"
android:entries="@array/rotation_text"
android:entryValues="@array/rotation_values"
android:summary="Test"/>
<ListPreference
android:id="@+id/lpListShowProducts"
android:key="list_show_products"
android:defaultValue="@string/txt_show_products_default"
android:title="@string/txt_show_products"
android:entries="@array/show_products_text"
android:entryValues="@array/show_products_values"
android:summary="Text"/>
</PreferenceCategory>
</PreferenceScreen>
Wie kann ich beim öffnen android:summary setzen?
Code:
[LEFT]public class Settings extends PreferenceActivity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.addPreferencesFromResource(R.xml.settings);
}
public static final SharedPreferences getSettings(final ContextWrapper ctx) {
return ctx.getSharedPreferences(ctx.getPackageName() + "_preferences", MODE_PRIVATE);
}
}[/LEFT]
Gruß