Im trying to use shared prefs to have a notification appear on the weekday the user sets in the prefs. I have already set up the alarmmanger to trigger the notification service at a set interval.
Now Im trying to get the selected day preference to compare to the actual day witch is read from calendar like this.
Using java Syntax Highlighting
- public void onCreate() {
- super.onCreate();
- nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
- Calendar cal = Calendar.getInstance();
- idag = cal.get(Calendar.DAY_OF_WEEK);
- SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
- valgtdag = sharedPrefs.getString("valgt_dag", "1");
- dag = getString(idag);
- if( dag == valgtdag)
- {
- showNotification();
- }
- else
- {
- }
- }
Parsed in 0.011 seconds, using GeSHi 1.0.8.4
Im getting error like this in DDMS:
String resource ID #0x3
Can anyone tell me what I have done wrong??
Thanks in advace