fixed memory leak warnings
This commit is contained in:
parent
e7f26ce17a
commit
bc43b1a2f7
2 changed files with 3 additions and 2 deletions
|
|
@ -205,7 +205,7 @@ public class CSVWriter {
|
|||
if(netInfo == null || netInfo.getType() != ConnectivityManager.TYPE_WIFI)
|
||||
return null;
|
||||
|
||||
WifiManager wm = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
||||
WifiManager wm = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
|
||||
WifiInfo wifiInfo = wm.getConnectionInfo();
|
||||
return wifiInfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@ public class WifiScanner {
|
|||
private WifiReceiver receiverWifi;
|
||||
|
||||
public WifiScanner() {
|
||||
mainWifi = (WifiManager) MainActivity.getContext().getSystemService(MainActivity.getContext().WIFI_SERVICE);
|
||||
mainWifi = (WifiManager) MainActivity.getContext().getApplicationContext()
|
||||
.getSystemService(MainActivity.getContext().WIFI_SERVICE);
|
||||
receiverWifi = new WifiReceiver();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue