Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
mkg20001 committed Feb 24, 2017
1 parent 3291a08 commit 3bca86b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wear/src/main/java/mkg20001/net/samremote/Remote.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ public void onClick(View v) {
};

public String getIPAddress() {
WifiManager wm = (WifiManager) getSystemService(WIFI_SERVICE);
WifiManager wm = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
return Formatter.formatIpAddress(wm.getConnectionInfo().getIpAddress());
}

private String getMACAddress() {
WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiManager manager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
WifiInfo info = manager.getConnectionInfo();
return info.getMacAddress();
}
Expand Down

0 comments on commit 3bca86b

Please sign in to comment.