mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
@@ -34,6 +34,8 @@
|
||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
android:maxSdkVersion="18" />
|
||||
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
||||
<application
|
||||
android:name="HabitsApplication"
|
||||
android:allowBackup="true"
|
||||
@@ -154,7 +156,11 @@
|
||||
android:resource="@xml/widget_frequency_info"/>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".HabitBroadcastReceiver"/>
|
||||
<receiver android:name=".HabitBroadcastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
</application>
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public class HabitBroadcastReceiver extends BroadcastReceiver
|
||||
{
|
||||
case ACTION_SHOW_REMINDER:
|
||||
createNotification(context, intent);
|
||||
createReminderAlarms(context);
|
||||
createReminderAlarmsDelayed(context);
|
||||
break;
|
||||
|
||||
case ACTION_DISMISS:
|
||||
@@ -71,10 +71,14 @@ public class HabitBroadcastReceiver extends BroadcastReceiver
|
||||
case ACTION_SNOOZE:
|
||||
snoozeHabit(context, intent);
|
||||
break;
|
||||
|
||||
case Intent.ACTION_BOOT_COMPLETED:
|
||||
ReminderHelper.createReminderAlarms(context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void createReminderAlarms(final Context context)
|
||||
private void createReminderAlarmsDelayed(final Context context)
|
||||
{
|
||||
new Handler().postDelayed(new Runnable()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user