mirror of
https://github.com/M66B/NetGuard.git
synced 2025-02-24 23:23:08 +00:00
Fixed crash
This commit is contained in:
parent
fac669371c
commit
adecd479dc
2 changed files with 8 additions and 3 deletions
|
@ -105,10 +105,14 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
|
||||||
|
|
||||||
WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE);
|
WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE);
|
||||||
List<CharSequence> listSSID = new ArrayList<>();
|
List<CharSequence> listSSID = new ArrayList<>();
|
||||||
listSSID.add("");
|
List<WifiConfiguration> configs = wm.getConfiguredNetworks();
|
||||||
for (WifiConfiguration config : wm.getConfiguredNetworks())
|
if (configs != null)
|
||||||
listSSID.add(config.SSID);
|
for (WifiConfiguration config : configs)
|
||||||
|
listSSID.add(config.SSID);
|
||||||
|
listSSID.add(0, getString(R.string.title_all));
|
||||||
wifi_home_pref.setEntries(listSSID.toArray(new CharSequence[0]));
|
wifi_home_pref.setEntries(listSSID.toArray(new CharSequence[0]));
|
||||||
|
listSSID.remove(0);
|
||||||
|
listSSID.add(0, "");
|
||||||
wifi_home_pref.setEntryValues(listSSID.toArray(new CharSequence[0]));
|
wifi_home_pref.setEntryValues(listSSID.toArray(new CharSequence[0]));
|
||||||
|
|
||||||
// Handle auto enable
|
// Handle auto enable
|
||||||
|
|
|
@ -62,6 +62,7 @@ Since NetGuard has no internet permission, you know your internet traffic is not
|
||||||
<string name="msg_terms">By donating you agree to the <a href="http://www.netguard.me/#terms">terms & conditions</a></string>
|
<string name="msg_terms">By donating you agree to the <a href="http://www.netguard.me/#terms">terms & conditions</a></string>
|
||||||
<string name="msg_dimming">If you cannot press OK in the next dialog, another (screen dimming) application is likely manipulating the screen.</string>
|
<string name="msg_dimming">If you cannot press OK in the next dialog, another (screen dimming) application is likely manipulating the screen.</string>
|
||||||
|
|
||||||
|
<string name="title_all">All</string>
|
||||||
<string name="title_screen_wifi">Allow Wi-Fi when screen is on</string>
|
<string name="title_screen_wifi">Allow Wi-Fi when screen is on</string>
|
||||||
<string name="title_screen_other">Allow mobile when screen is on</string>
|
<string name="title_screen_other">Allow mobile when screen is on</string>
|
||||||
<string name="title_roaming">Block when roaming</string>
|
<string name="title_roaming">Block when roaming</string>
|
||||||
|
|
Loading…
Reference in a new issue