-1

I know the solution might be somewhere, but I tried searching, but can't fix anything. what is wrong? I don't get it. this is what I have

 <receiver
      android:name="com.example.listeners.screenlistener"
      android:enabled="true" >
      <intent-filter>
           <action android:name="android.intent.action.SCREEN_ON" />
      </intent-filter> 
 </receiver>
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
DaveZ
  • 3
  • 2

1 Answers1

1

Taking a quick stab at this, to receive the SCREEN_ON or other protected broadcasts, you have to register the receiver in code somewhere and not in the manifest.

Working example here:

BroadcastReceiver for Screen On/Off not working

Edit: I provided this answer as I remember trying something similar about a year ago when I was just learning Android. The question could certainly do with more clarification on what the user is trying/has tried to do.

Community
  • 1
  • 1