Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix error looking up the WIFI_SERVICE #30

Closed
mathisdt opened this issue Jan 11, 2018 · 1 comment
Closed

fix error looking up the WIFI_SERVICE #30

mathisdt opened this issue Jan 11, 2018 · 1 comment

Comments

@mathisdt
Copy link
Owner

trackworktime/app/src/main/java/org/zephyrsoft/trackworktime/location/WifiTrackerService.java:50:
Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on
devices < Android N. Try changing  to .getApplicationContext()  [WifiManagerLeak]
  wifiTracker = new WifiTracker((WifiManager) getSystemService(Context.WIFI_SERVICE), basics.getTimerManager(),
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Explanation for issues of type "WifiManagerLeak":
   On versions prior to Android N (24), initializing the WifiManager via
   Context#getSystemService can cause a memory leak if the context is not the
   application context. Change context.getSystemService(...) to
   context.getApplicationContext().getSystemService(...).
@mathisdt
Copy link
Owner Author

fixed in 91cba28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant