Permalink
Browse files

Merge pull request #944 from amuino/fix_scan_succeed_and_fail

FIX: [BarcodeScanner][Android] valid scans would report a success and an error every time
  • Loading branch information...
2 parents c8cb897 + be896ed commit f3566442cd1fab8103f22758f2117304ad29ac79 @macdonst macdonst committed Dec 16, 2012
@@ -110,7 +110,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) {
//Log.d(LOG_TAG, "This should never happen");
}
this.success(new PluginResult(PluginResult.Status.OK, obj), this.callback);
- } if (resultCode == Activity.RESULT_CANCELED) {
+ } else if (resultCode == Activity.RESULT_CANCELED) {
JSONObject obj = new JSONObject();
try {
obj.put("text", "");
@@ -121,7 +121,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) {
//Log.d(LOG_TAG, "This should never happen");
}
this.success(new PluginResult(PluginResult.Status.OK, obj), this.callback);
- } if (resultCode == Activity.RESULT_CANCELED) {
+ } else if (resultCode == Activity.RESULT_CANCELED) {
JSONObject obj = new JSONObject();
try {
obj.put(TEXT, "");

0 comments on commit f356644

Please sign in to comment.