In manifest xml:
<receiver android:label="BGTasksBroadcast" android:name=".BGTasksBroadcast">
<intent-filter>
<action android:name="android.intent.action.SCREEN_ON" />
<action android:name="android.intent.action.REBOOT" />
</intent-filter>
</receiver>
In broadcast receiver:
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Log.d("Log", "BROADCAST RECEIVER " );
}
When I launch the app I am not seeing the log “BROADCAST RECEIVER “.
If you lock and unlock your device di you see it ?
are different from app launch.
Android does not seem to support manifest-registered receivers for cases where they really do not want to start up a new process. For example, you will see the same effect with the battery info actions (e.g., BATTERY_LOW). (cc CommonsWare) you have to start them from the code, see here: android.intent.action.SCREEN_ON doesn't work as a receiver intent filter