diff --git a/src/main/java/com/nutomic/syncthingandroid/views/EnhancedEditText.java b/src/main/java/com/nutomic/syncthingandroid/views/EnhancedEditText.java index 3817158d..6df87421 100644 --- a/src/main/java/com/nutomic/syncthingandroid/views/EnhancedEditText.java +++ b/src/main/java/com/nutomic/syncthingandroid/views/EnhancedEditText.java @@ -1,11 +1,11 @@ package com.nutomic.syncthingandroid.views; import android.content.Context; +import android.support.v7.widget.AppCompatEditText; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; -import android.widget.EditText; import static android.view.inputmethod.EditorInfo.IME_FLAG_NO_ENTER_ACTION; @@ -18,7 +18,7 @@ import static android.view.inputmethod.EditorInfo.IME_FLAG_NO_ENTER_ACTION; * of the IME action button with the new line character. This allows rendering soft wraps on single * line input. */ -public class EnhancedEditText extends EditText { +public class EnhancedEditText extends AppCompatEditText { public EnhancedEditText(Context context) { super(context); diff --git a/src/main/java/com/nutomic/syncthingandroid/views/WifiSsidPreference.java b/src/main/java/com/nutomic/syncthingandroid/views/WifiSsidPreference.java index a5f0fa97..05d5f1c4 100644 --- a/src/main/java/com/nutomic/syncthingandroid/views/WifiSsidPreference.java +++ b/src/main/java/com/nutomic/syncthingandroid/views/WifiSsidPreference.java @@ -109,7 +109,8 @@ public class WifiSsidPreference extends MultiSelectListPreference { * @return a sorted array of WifiConfiguration, or null, if data cannot be retrieved */ private WifiConfiguration[] loadConfiguredNetworksSorted() { - WifiManager wifiManager = (WifiManager) getContext().getSystemService(Context.WIFI_SERVICE); + WifiManager wifiManager = (WifiManager) + getContext().getApplicationContext().getSystemService(Context.WIFI_SERVICE); if (wifiManager != null) { List configuredNetworks = wifiManager.getConfiguredNetworks(); // if WiFi is turned off, getConfiguredNetworks returns null on many devices