Issue
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?
Solution
NYC, New York Cheesecake, is the internal codename of Android N (Nougat, 7.0)
Source: https://venturebeat.com/2016/03/15/android-ns-internal-codename-is-new-york-cheesecake/
Answered By - Bruno
Answer Checked By - Senaida (JavaFixing Volunteer)