My App is monitoring the network connection changes to decode offline and online cases. Here I want to continuously monitor this only when the app is in the foreground. How