Fixe as per https://developer.android.com/reference/android/content/ContextWrapper#getApplicationContext()
SHAPE_HEIGHT = (int) (this.getWindowManager().getDefaultDisplay().getHeight() * 45 / BoxType.DESTINATION_HEIGHT);
// From Robot_Demo project.
- wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
+ wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
wifiLock = (WifiLock) wifiManager.createWifiLock((
(android.os.Build.VERSION.SDK_INT >= 12)
? WifiManager.WIFI_MODE_FULL_HIGH_PERF
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.layout.activity_settings);
- WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
+ WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
EditTextPreference pref = (EditTextPreference) findPreference("prefManagers");
//TODO should be done in respect to @strings