Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Jul 19, 2012
1 parent 1785216 commit 09b5872
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
4 changes: 2 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
android:icon="@drawable/icon"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock" >
<activity
Expand Down Expand Up @@ -61,4 +61,4 @@
</receiver>
</application>

</manifest>
</manifest>
Binary file removed res/drawable-hdpi/icon.png
Binary file not shown.
Binary file removed res/drawable-ldpi/icon.png
Binary file not shown.
Binary file removed res/drawable-mdpi/icon.png
Binary file not shown.
Binary file removed res/drawable-xhdpi/icon.png
Binary file not shown.
33 changes: 21 additions & 12 deletions src/org/proxydroid/ProxyDroid.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,20 +228,29 @@ private void loadNetworkList() {
WifiManager wm = (WifiManager) this
.getSystemService(Context.WIFI_SERVICE);
List<WifiConfiguration> wcs = wm.getConfiguredNetworks();

String[] ssidEntries = null;
int n = 3;

String[] ssidEntries = new String[wcs.size() + n];
ssidEntries[0] = Constraints.WIFI_AND_3G;
ssidEntries[1] = Constraints.ONLY_WIFI;
ssidEntries[2] = Constraints.ONLY_3G;

for (WifiConfiguration wc : wcs) {
if (wc != null && wc.SSID != null)
ssidEntries[n++] = wc.SSID.replace("\"", "");
else
ssidEntries[n++] = "unknown";
}
if (wcs == null) {
ssidEntries = new String[n];

ssidEntries[0] = Constraints.WIFI_AND_3G;
ssidEntries[1] = Constraints.ONLY_WIFI;
ssidEntries[2] = Constraints.ONLY_3G;
} else {
ssidEntries = new String[wcs.size() + n];

ssidEntries[0] = Constraints.WIFI_AND_3G;
ssidEntries[1] = Constraints.ONLY_WIFI;
ssidEntries[2] = Constraints.ONLY_3G;

for (WifiConfiguration wc : wcs) {
if (wc != null && wc.SSID != null)
ssidEntries[n++] = wc.SSID.replace("\"", "");
else
ssidEntries[n++] = "unknown";
}
}
ssidList.setEntries(ssidEntries);
ssidList.setEntryValues(ssidEntries);
}
Expand Down

0 comments on commit 09b5872

Please sign in to comment.