Detects the change in wifi network and triggers the required set of events.