aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--proguard.flags2
-rw-r--r--res/values-nl/donottranslate.xml1
-rw-r--r--src/com/cyanogenmod/lockclock/preference/CalendarPreferences.java16
3 files changed, 11 insertions, 8 deletions
diff --git a/proguard.flags b/proguard.flags
index 3f05868..933b849 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -1,3 +1,3 @@
--keep class com.cyanogenmod.lockclock.Preferences {
+-keep class com.cyanogenmod.lockclock.preference.Preferences {
*;
}
diff --git a/res/values-nl/donottranslate.xml b/res/values-nl/donottranslate.xml
index 1f17dc8..bc6a446 100644
--- a/res/values-nl/donottranslate.xml
+++ b/res/values-nl/donottranslate.xml
@@ -17,5 +17,4 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="abbrev_wday_month_day_no_year">EEE d MMMM</string>
- <string name="full_wday_month_day_no_year">EEEE d MMMM</string>
</resources>
diff --git a/src/com/cyanogenmod/lockclock/preference/CalendarPreferences.java b/src/com/cyanogenmod/lockclock/preference/CalendarPreferences.java
index beb088c..6caf183 100644
--- a/src/com/cyanogenmod/lockclock/preference/CalendarPreferences.java
+++ b/src/com/cyanogenmod/lockclock/preference/CalendarPreferences.java
@@ -19,6 +19,7 @@ package com.cyanogenmod.lockclock.preference;
import static com.cyanogenmod.lockclock.misc.Constants.PREF_NAME;
import android.app.Activity;
+import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -82,7 +83,6 @@ public class CalendarPreferences extends PreferenceFragment implements
// Utility classes and supporting methods
//===============================================================================================
- @SuppressWarnings("deprecation")
private static class CalendarEntries {
private final CharSequence[] mEntries;
private final CharSequence[] mEntryValues;
@@ -98,16 +98,20 @@ public class CalendarPreferences extends PreferenceFragment implements
private static final int CALENDAR_ID_INDEX = 0;
private static final int DISPLAY_NAME_INDEX = 1;
- static CalendarEntries findCalendars(Activity activity) {
+ static CalendarEntries findCalendars(Context context) {
List<CharSequence> entries = new ArrayList<CharSequence>();
List<CharSequence> entryValues = new ArrayList<CharSequence>();
+ ContentResolver cr = context.getContentResolver();
- Cursor calendarCursor = activity.managedQuery(uri, projection, null, null, null);
- if (calendarCursor.moveToFirst()) {
- do {
+ Cursor calendarCursor = cr.query(uri, projection, null, null, null);
+ if (calendarCursor != null) {
+ calendarCursor.moveToFirst();
+ while (!calendarCursor.isAfterLast()) {
entryValues.add(calendarCursor.getString(CALENDAR_ID_INDEX));
entries.add(calendarCursor.getString(DISPLAY_NAME_INDEX));
- } while (calendarCursor.moveToNext());
+ calendarCursor.moveToNext();
+ }
+ calendarCursor.close();
}
return new CalendarEntries(entries, entryValues);