I tried to create an example of work after rebooting the device and, like John Naylor, I was confused.
The example is extremely simple.
1. I have Android 13.
2. Manifest Contents:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="33"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
AddPermission(android.permission.RECEIVE_BOOT_COMPLETED)
AddReceiverText(StartupReceiver, <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>)
3. Receiver Module StartupReceiver:
Private Sub Receiver_Receive (FirstTime As Boolean, StartingIntent As Intent)
StartReceiverAt(MyReceiver, DateTime.Now + 15 * DateTime.TicksPerMinute, True)
End Sub
4. Receiver Module MyReceiver:
Private Sub Receiver_Receive (FirstTime As Boolean, StartingIntent As Intent)
Log("MyReceiver is working!")
Dim n As Notification
n.Initialize
n.Icon = "icon"
n.SetInfo("Test", "Receiver fired - " & cnt, Main)
n.Notify (1)
cnt = cnt + 1
End Sub
That's it, there is nothing else in the Project.
The only goal of the Project: after rebooting the device, receive the intent and call MyReceiver.
I need to make sure that MyReceiver is working in order to perform the actions I need in it.
It would be quite enough for me to send a Notify to the client.
But this doesn't happen. What is the problem?