diff --git a/.idea/libraries/library_1_5_2.xml b/.idea/libraries/library_1_5_2.xml
deleted file mode 100644
index d72fdf4..0000000
--- a/.idea/libraries/library_1_5_2.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/HypoAlarm/HypoAlarm-HypoAlarm.iml b/HypoAlarm/HypoAlarm-HypoAlarm.iml
index fa07357..70b00c6 100644
--- a/HypoAlarm/HypoAlarm-HypoAlarm.iml
+++ b/HypoAlarm/HypoAlarm-HypoAlarm.iml
@@ -8,11 +8,10 @@
-
-
-
-
-
+
+
+
+
@@ -22,26 +21,21 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -75,7 +69,6 @@
-
diff --git a/HypoAlarm/build.gradle b/HypoAlarm/build.gradle
index 9d758da..8370ce7 100644
--- a/HypoAlarm/build.gradle
+++ b/HypoAlarm/build.gradle
@@ -32,12 +32,10 @@ dependencies {
compile 'net.frakbot.glowpadbackport:glowpadbackport:+'
//compile 'net.frakbot.glowpadbackport:glowpadbackport:2.1.0'
- compile 'com.doomonafireball.betterpickers:library:+'
+ //compile 'com.doomonafireball.betterpickers:library:+'
//compile 'com.doomonafireball.betterpickers:library:1.5.2'
+ //compile 'com.doomonafireball.betterpickers:library:1.5.3-SNAPSHOT'
- //compile project(':GlowPadBackport')
- //compile project(':SeekArc')
-
- //compile fileTree(dir: 'libs', include: ['*.aar'])
- //compile fileTree(dir: 'libs', include: ['*.jar'])
+ //compile 'com.github.flavienlaurent.datetimepicker:library:+'
+ //compile 'com.github.flavienlaurent.datetimepicker:library:0.0.1'
}
diff --git a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmAlertActivity.java b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmAlertActivity.java
index b558b0f..39b439e 100644
--- a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmAlertActivity.java
+++ b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmAlertActivity.java
@@ -13,11 +13,17 @@ import net.frakbot.glowpadbackport.GlowPadView;
public class AlarmAlertActivity extends Activity {
public static Activity alertActivity;
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ alertActivity = null;
+ }
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- // Self-reference so we can run finish() from outside.
+ // Self-reference so we can run finish() from other classes
alertActivity = this;
requestWindowFeature(Window.FEATURE_NO_TITLE);
diff --git a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmService.java b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmService.java
index 0d96458..0a7061f 100644
--- a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmService.java
+++ b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/AlarmService.java
@@ -21,7 +21,6 @@ public class AlarmService extends Service {
private static final int SNOOZE_TIME = 1000*60*5; // Snooze for 5 minutes if need be
private static final int ALERT_LIFE = 1000*60*2; // 2 minutes
private static PowerManager.WakeLock wl;
- private static AlarmManager alarmManager;
private static Intent alarmServiceIntent, alertActivityIntent, notifyIntent;
private static Boolean alarmStarted = false;
public static volatile String alarmStatus; // Register ALARM_DISMISSED and its brethren here
@@ -39,9 +38,6 @@ public class AlarmService extends Service {
wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "AlarmService");
// TODO: wake lock?
//wl.acquire();
-
- alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
-
}
@Override
public void onDestroy() {
@@ -74,7 +70,6 @@ public class AlarmService extends Service {
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
if (alarmStarted) {
- stopAlert(getApplicationContext());
stopService(notifyIntent);
}
alarmStarted = true;
diff --git a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/CancelAlarmReceiver.java b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/CancelAlarmReceiver.java
index 29e5793..112d739 100644
--- a/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/CancelAlarmReceiver.java
+++ b/HypoAlarm/src/main/java/za/org/treehouse/hypoalarm/CancelAlarmReceiver.java
@@ -34,6 +34,7 @@ public class CancelAlarmReceiver extends BroadcastReceiver {
Toast.makeText(context, context.getString(R.string.alarmCancelToast), Toast.LENGTH_LONG).show();
// Stop any snoozed/existing alarms that may have started
+ AlarmService.setAlarmStatus(AlarmService.ALARM_DISMISSED);
context.stopService(new Intent(context, AlarmService.class));
// Remove notification