--- android/Side9/src/dk/thoerup/side9/Side9Config.java 2010/06/16 07:45:53 856 +++ android/Side9/src/dk/thoerup/side9/Side9Config.java 2010/06/16 07:51:40 857 @@ -18,6 +18,12 @@ public class Side9Config extends Activity { int mAppWidgetId; + public final static String PREFS_SAVEIMAGE = "saveimage"; + public final static String PREFS_SHOWCAPTION = "showcaption"; + public final static String PREFS_ONTOUCH = "ontouch"; + + + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -39,11 +45,11 @@ okBtn.setOnClickListener( okListener ); CheckBox savetosd = (CheckBox) findViewById(R.id.savetosd); - boolean save = prefs.getBoolean("saveimage", false); + boolean save = prefs.getBoolean(PREFS_SAVEIMAGE, false); savetosd.setChecked(save); CheckBox showcaption = (CheckBox) findViewById(R.id.showcaption); - boolean show = prefs.getBoolean("showcaption", false); + boolean show = prefs.getBoolean(PREFS_SHOWCAPTION, false); showcaption.setChecked(show); @@ -53,7 +59,7 @@ ontouch.setAdapter(adapter); - int ontouchsel = prefs.getInt("ontouch", 0); + int ontouchsel = prefs.getInt(PREFS_ONTOUCH, 0); ontouch.setSelection(ontouchsel); } @@ -86,9 +92,9 @@ SharedPreferences prefs = getSharedPreferences(Side9WidgetProvider.TAG, Context.MODE_PRIVATE); Editor edit = prefs.edit(); - edit.putBoolean("saveimage", save); - edit.putBoolean("showcaption", show); - edit.putInt("ontouch", ontouchsel); + edit.putBoolean(PREFS_SAVEIMAGE, save); + edit.putBoolean(PREFS_SHOWCAPTION, show); + edit.putInt(PREFS_ONTOUCH, ontouchsel); edit.commit(); Intent resultValue = new Intent();