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