Small style things
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Wed, 23 Jun 2010 10:23:09 +0000 (10:23 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Wed, 23 Jun 2010 10:23:09 +0000 (10:23 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@1457 59b500cc-1b3d-0410-9834-0bbf25fbcc57

android/src/com/google/zxing/client/android/result/WifiResultHandler.java
android/src/com/google/zxing/client/android/wifi/ConnectedReceiver.java
android/src/com/google/zxing/client/android/wifi/WifiActivity.java

index 1cc2b5d..2ef26c2 100644 (file)
@@ -28,10 +28,9 @@ import com.google.zxing.client.result.WifiParsedResult;
  * @author viki@google.com (Vikram Aggarwal)
  */
 public final class WifiResultHandler extends ResultHandler {
-  Activity parentActivity = null;
+
   public WifiResultHandler(Activity activity, ParsedResult result) {
     super(activity, result);
-    parentActivity = activity;
   }
 
   @Override
@@ -42,24 +41,18 @@ public final class WifiResultHandler extends ResultHandler {
 
   @Override
   public int getButtonText(int index) {
-    switch (index) {
-    case 0:
+    if (index == 0) {
       return R.string.button_wifi;
-    default:
-      throw new ArrayIndexOutOfBoundsException();
     }
+    throw new ArrayIndexOutOfBoundsException();
   }
 
   @Override
   public void handleButtonPress(int index) {
     // Get the underlying wifi config
     WifiParsedResult wifiResult = (WifiParsedResult) getResult();
-    switch (index) {
-    case 0:
+    if (index == 0) {
       wifiConnect(wifiResult);
-      break;
-    default:
-      break;
     }
   }
 
index 40ce99c..c42852b 100644 (file)
@@ -1,10 +1,22 @@
-package com.google.zxing.client.android.wifi;
+/*
+ * Copyright (C) 2010 ZXing authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
-import com.google.zxing.client.android.R;
+package com.google.zxing.client.android.wifi;
 
 import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.ActivityNotFoundException;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
index b86fed0..948aa45 100644 (file)
@@ -19,12 +19,9 @@ package com.google.zxing.client.android.wifi;
 import java.util.List;
 
 import android.app.Activity;
-import android.app.AlertDialog;
-import android.content.ActivityNotFoundException;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.net.ConnectivityManager;
-import android.net.Uri;
 import android.net.wifi.WifiConfiguration;
 import android.net.wifi.WifiManager;
 import android.os.Bundle;