/[projects]/android/Side9/src/dk/thoerup/side9/Side9Config.java
ViewVC logotype

Diff of /android/Side9/src/dk/thoerup/side9/Side9Config.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 856 by torben, Wed Jun 16 07:40:59 2010 UTC revision 857 by torben, Wed Jun 16 07:51:40 2010 UTC
# Line 18  import android.widget.Spinner; Line 18  import android.widget.Spinner;
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);
# Line 39  public class Side9Config extends Activit Line 45  public class Side9Config extends Activit
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                                    
# Line 53  public class Side9Config extends Activit Line 59  public class Side9Config extends Activit
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          }          }
# Line 86  public class Side9Config extends Activit Line 92  public class Side9Config extends Activit
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();

Legend:
Removed from v.856  
changed lines
  Added in v.857

  ViewVC Help
Powered by ViewVC 1.1.20