I want to use preferences, but I don't want to use it in xml. I used this to find my xml:
this.addPreferencesFromResource(R.xml.settings);
And this is my .xml:
<PreferenceCategory android:title="name">
<ListPreference android:key="name" android:title="Find name" android:summary="Select your name"
android:defaultValue="2" android:entries="@array/name" android:entryValues="@array/nameValues"/>
</PreferenceCategory>
This works! But how can I do declare the preferences in my activity .java without the xml file? Maybe someone can give me a short sample code for my short code.
Thanks.