It is necessary that the AlarmManager be triggered at a certain time. If the phone does not restart, then everything runs smoothly (for example, set at 6 pm, then it works at 6 pm). If you reload, insert in the manifest

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

<action android:name="android.intent.action.BOOT_COMPLETED" />

then it will work instantly after a reboot, without - it does not work at all

    1 answer 1

    It is necessary to register in the code. Usually looks like this: In the manifest

      <receiver android:name=".BootReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"> <category android:name="android.intent.category.HOME" /> </intent-filter> </receiver> 

    In code

     public class BootReceiver extends WakefulBroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { // запускаем аларм } } 
    • Re-set the alarm in the receiver? Those. the system is as follows: Without rebooting, I simply set an alarm on this receiver in a random class, when I reboot, I set an alarm, it starts the receiver, again I set the alarm again? - Ivan