Commit f873a096 by Sebastián Katzer

The application context needs to be set as first after reboot

parent 6e82355c
......@@ -40,6 +40,9 @@ public class Restore extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// The application context needs to be set as first
LocalNotification.setContext(context);
// Obtain alarm details form Shared Preferences
SharedPreferences alarms = LocalNotification.getSharedPreferences();
Set<String> alarmIds = alarms.getAll().keySet();
......@@ -53,8 +56,6 @@ public class Restore extends BroadcastReceiver {
JSONArray args = new JSONArray(alarms.getString(alarmId, ""));
Options options = new Options(context).parse(args.getJSONObject(0));
// The context got lost after reboot
LocalNotification.setContext(context);
LocalNotification.add(options);
} catch (JSONException e) {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment