You can also intercept it with the PhoneEvents (ScreenOn and ScreenOff events). Note that the service must be running in order to intercept these events. That means that you need to call Service.StartForeground.
Thank you Erel.
May be I understand (theoretical) what you try to tell me.
But will explain what I try to reach:
I want to have a reminder for some appointments via msgbox ( this is allready finished ). But this reminder should come up each time I unlock my tablet.
So, I have to create a service (start by reboot). In that service I have to create the broadcastreceiver. If the broadcastreceiver receive the ScreenOn broadcast, the service has to start the msgbox. After clicking OK the msgbox disappears and the ExitApplication close the app. Now the broadcastreceiver wait for the next ScreenOn broadcast.
Is this the correct way?
But do not know, how to implement such a service.
Do you have a codesnippet for me, to bring some light in my brain ?
Hi you need to set up a broadcastreceiver, you can either write your own library, probably use the reflection library or the easiest one is to use
@XverhelstX BroadcastReceiver library
Thank you lagore. Is it easier with that library? But the same questions as above