Android - how to receive broadcast intents ACTION_SCREEN_ON/OFF?
问题 <application> <receiver android:name=".MyBroadcastReceiver" android:enabled="true"> <intent-filter> <action android:name="android.intent.action.ACTION_SCREEN_ON"></action> <action android:name="android.intent.action.ACTION_SCREEN_OFF"></action> </intent-filter> </receiver> ... </application> MyBroadcastReceiver is set just to spit foo to the logs. Does nothing. Any suggestions please? Do I need to assign any permissions to catch the intent? 回答1: I believe that those actions can only be