Use app context for getting WiFi service to address warnings in new build tools

This commit is contained in:
Cameron Gutman
2017-03-10 22:18:23 -08:00
parent 7978687bfc
commit b2a36c2c73
2 changed files with 2 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ public class DiscoveryService extends Service {
@Override
public void onCreate() {
WifiManager wifiMgr = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiManager wifiMgr = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
multicastLock = wifiMgr.createMulticastLock("Limelight mDNS");
multicastLock.setReferenceCounted(false);