dimanche 5 juin 2016

How to detect Screen On / Screen Off by intent?

Hi,
I can detect screen on/off by using PhoneEvents but to check it for long run, I need to use service and must to display notification icon. So I want to detect it by intent with this.

Manifest code:

Code:
  AddPermission(android.permission.READ_PHONE_STATE)
AddReceiverText(service1,
<
intent-filter>
<action android:name=
"android.intent.action.SCREEN_OFF"/>
<action android:name=
"android.intent.action.SCREEN_ON"/>
</
intent-filter>
)
service1 code:
Code:
  Sub...  
How to detect Screen On / Screen Off by intent?

from B4X Community - Android, iOS, desktop, server and IoT programming tools http://ift.tt/1UqCPaU
via IFTTT

Aucun commentaire:

Enregistrer un commentaire