18 |
public class Side9Config extends Activity { |
public class Side9Config extends Activity { |
19 |
int mAppWidgetId; |
int mAppWidgetId; |
20 |
|
|
21 |
|
public final static String PREFS_SAVEIMAGE = "saveimage"; |
22 |
|
public final static String PREFS_SHOWCAPTION = "showcaption"; |
23 |
|
public final static String PREFS_ONTOUCH = "ontouch"; |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
@Override |
@Override |
28 |
public void onCreate(Bundle savedInstanceState) { |
public void onCreate(Bundle savedInstanceState) { |
29 |
super.onCreate(savedInstanceState); |
super.onCreate(savedInstanceState); |
45 |
okBtn.setOnClickListener( okListener ); |
okBtn.setOnClickListener( okListener ); |
46 |
|
|
47 |
CheckBox savetosd = (CheckBox) findViewById(R.id.savetosd); |
CheckBox savetosd = (CheckBox) findViewById(R.id.savetosd); |
48 |
boolean save = prefs.getBoolean("saveimage", false); |
boolean save = prefs.getBoolean(PREFS_SAVEIMAGE, false); |
49 |
savetosd.setChecked(save); |
savetosd.setChecked(save); |
50 |
|
|
51 |
CheckBox showcaption = (CheckBox) findViewById(R.id.showcaption); |
CheckBox showcaption = (CheckBox) findViewById(R.id.showcaption); |
52 |
boolean show = prefs.getBoolean("showcaption", false); |
boolean show = prefs.getBoolean(PREFS_SHOWCAPTION, false); |
53 |
showcaption.setChecked(show); |
showcaption.setChecked(show); |
54 |
|
|
55 |
|
|
59 |
|
|
60 |
ontouch.setAdapter(adapter); |
ontouch.setAdapter(adapter); |
61 |
|
|
62 |
int ontouchsel = prefs.getInt("ontouch", 0); |
int ontouchsel = prefs.getInt(PREFS_ONTOUCH, 0); |
63 |
ontouch.setSelection(ontouchsel); |
ontouch.setSelection(ontouchsel); |
64 |
|
|
65 |
} |
} |
92 |
SharedPreferences prefs = getSharedPreferences(Side9WidgetProvider.TAG, Context.MODE_PRIVATE); |
SharedPreferences prefs = getSharedPreferences(Side9WidgetProvider.TAG, Context.MODE_PRIVATE); |
93 |
|
|
94 |
Editor edit = prefs.edit(); |
Editor edit = prefs.edit(); |
95 |
edit.putBoolean("saveimage", save); |
edit.putBoolean(PREFS_SAVEIMAGE, save); |
96 |
edit.putBoolean("showcaption", show); |
edit.putBoolean(PREFS_SHOWCAPTION, show); |
97 |
edit.putInt("ontouch", ontouchsel); |
edit.putInt(PREFS_ONTOUCH, ontouchsel); |
98 |
edit.commit(); |
edit.commit(); |
99 |
|
|
100 |
Intent resultValue = new Intent(); |
Intent resultValue = new Intent(); |