add broadcastReceiver to receive foreground information.