[SCM] Multi-format 1D/2D barcode image processing library branch, upstream, updated. 24d4480bc48cf9eabf7b2bd2f528248b0e458809
vikrama
vikrama at 59b500cc-1b3d-0410-9834-0bbf25fbcc57
Wed Aug 4 01:32:29 UTC 2010
The following commit has been merged in the upstream branch:
commit 6e75ec5ea702e4e783f0e3a7a4aad3213192f773
Author: vikrama <vikrama at 59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Date: Fri Jul 9 17:14:04 2010 +0000
Fixed: pause -> onPause, resume -> onResume
Make sure the ssid we are connected to is not null. This happens when
a network has been updated/removed while we are still connected to it.
Make errorCount an instance variable.
git-svn-id: http://zxing.googlecode.com/svn/trunk@1474 59b500cc-1b3d-0410-9834-0bbf25fbcc57
diff --git a/android/src/com/google/zxing/client/android/wifi/WifiActivity.java b/android/src/com/google/zxing/client/android/wifi/WifiActivity.java
index f39b732..eca347f 100644
--- a/android/src/com/google/zxing/client/android/wifi/WifiActivity.java
+++ b/android/src/com/google/zxing/client/android/wifi/WifiActivity.java
@@ -44,13 +44,9 @@ public class WifiActivity extends Activity {
private WifiReceiver wifiReceiver;
private boolean receiverRegistered;
private int networkId;
- private static int errorCount;
+ private int errorCount;
private IntentFilter mWifiStateFilter;
- static {
- errorCount = 0;
- }
-
public void gotError(){
final int maxErrorCount = 3;
errorCount++;
@@ -243,14 +239,18 @@ public class WifiActivity extends Activity {
changeNetwork(setting);
}
- public void pause() {
+ @Override
+ public void onPause() {
+ super.onPause();
if (receiverRegistered) {
unregisterReceiver(wifiReceiver);
receiverRegistered = false;
}
}
- public void resume() {
+ @Override
+ public void onResume() {
+ super.onResume();
if (wifiReceiver != null && mWifiStateFilter != null && !receiverRegistered) {
registerReceiver(wifiReceiver, mWifiStateFilter);
receiverRegistered = true;
@@ -259,6 +259,7 @@ public class WifiActivity extends Activity {
@Override
protected void onDestroy() {
+ super.onDestroy();
if (wifiReceiver != null) {
if (receiverRegistered) {
unregisterReceiver(wifiReceiver);
diff --git a/android/src/com/google/zxing/client/android/wifi/WifiReceiver.java b/android/src/com/google/zxing/client/android/wifi/WifiReceiver.java
index 1e640b8..e337549 100644
--- a/android/src/com/google/zxing/client/android/wifi/WifiReceiver.java
+++ b/android/src/com/google/zxing/client/android/wifi/WifiReceiver.java
@@ -60,7 +60,7 @@ final class WifiReceiver extends BroadcastReceiver {
final NetworkInfo.State state = i.getState();
final String ssid = mWifiManager.getConnectionInfo().getSSID();
- if (state == NetworkInfo.State.CONNECTED){
+ if (state == NetworkInfo.State.CONNECTED && ssid != null){
mWifiManager.saveConfiguration();
final String label = parent.getString(R.string.wifi_connected);
statusView.setText(label + "\n" + ssid);
--
Multi-format 1D/2D barcode image processing library
More information about the Pkg-google-commits
mailing list