On this Android developer document, there is a statement for WIFI_SERVICE definition.
A WifiManager for management of Wi-Fi connectivity. On releases before NYC, it should only be obtained from an application context, and not from any other derived context to avoid memory leaks within the calling process.
Try to understand when I need to get the wifi service from application context?