How to set the Default Value of a ListPreference

You don’t need to programmatically handle the default value of ListPreferences. You can do this in xml setting file. Below is an example <string-array name=”opts”> <item>red</item> <item>green</item> <item>blue</item> </string-array> <string-array name=”opts_values”> <item>1</item> <item>2</item> <item>3</item> </string-array> … <ListPreference android:title=”Colour select” android:summary=”Select your favourite” android:key=”colour” android:entries=”@array/opts” android:entryValues=”@array/opts_values” android:defaultValue=”2″ /> here I selected 2 as a default value. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)