From f79bb976059a91c86fcd7c25842e9b11904f7bb9 Mon Sep 17 00:00:00 2001 From: srowen Date: Mon, 3 Mar 2008 22:07:43 +0000 Subject: [PATCH] Don't like using == instead of equals() here, even though it's valid here. Fixed that. git-svn-id: https://zxing.googlecode.com/svn/trunk@240 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../google/zxing/client/android/ResultHandler.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/android/src/com/google/zxing/client/android/ResultHandler.java b/android/src/com/google/zxing/client/android/ResultHandler.java index 2489ceb9a..0f20b2df7 100755 --- a/android/src/com/google/zxing/client/android/ResultHandler.java +++ b/android/src/com/google/zxing/client/android/ResultHandler.java @@ -55,7 +55,7 @@ final class ResultHandler extends Handler { if (message.what == R.string.button_yes) { Intent intent = null; ParsedReaderResultType type = result.getType(); - if (type == ParsedReaderResultType.ADDRESSBOOK) { + if (type.equals(ParsedReaderResultType.ADDRESSBOOK)) { AddressBookDoCoMoResult addressResult = (AddressBookDoCoMoResult) result; intent = new Intent(Contacts.Intents.Insert.ACTION, Contacts.People.CONTENT_URI); putExtra(intent, Contacts.Intents.Insert.NAME, addressResult.getName()); @@ -63,7 +63,7 @@ final class ResultHandler extends Handler { putExtra(intent, Contacts.Intents.Insert.EMAIL, addressResult.getEmail()); putExtra(intent, Contacts.Intents.Insert.NOTES, addressResult.getNote()); putExtra(intent, Contacts.Intents.Insert.POSTAL, addressResult.getAddress()); - } else if (type == ParsedReaderResultType.BOOKMARK) { + } else if (type.equals(ParsedReaderResultType.BOOKMARK)) { // For now, we can only open the browser, and not actually add a bookmark try { intent = new Intent(Intent.VIEW_ACTION, @@ -71,14 +71,14 @@ final class ResultHandler extends Handler { } catch (URISyntaxException e) { return; } - } else if (type == ParsedReaderResultType.URLTO) { + } else if (type.equals(ParsedReaderResultType.URLTO)) { try { intent = new Intent(Intent.VIEW_ACTION, new ContentURI(((URLTOResult) result).getURI())); } catch (URISyntaxException e) { return; } - } else if (type == ParsedReaderResultType.EMAIL) { + } else if (type.equals(ParsedReaderResultType.EMAIL)) { EmailDoCoMoResult emailResult = (EmailDoCoMoResult) result; try { intent = new Intent(Intent.SENDTO_ACTION, new ContentURI(emailResult.getTo())); @@ -87,14 +87,14 @@ final class ResultHandler extends Handler { } putExtra(intent, "subject", emailResult.getSubject()); putExtra(intent, "body", emailResult.getBody()); - } else if (type == ParsedReaderResultType.EMAIL_ADDRESS) { + } else if (type.equals(ParsedReaderResultType.EMAIL_ADDRESS)) { EmailAddressResult emailResult = (EmailAddressResult) result; try { intent = new Intent(Intent.SENDTO_ACTION, new ContentURI(emailResult.getEmailAddress())); } catch (URISyntaxException e) { return; } - } else if (type == ParsedReaderResultType.UPC) { + } else if (type.equals(ParsedReaderResultType.UPC)) { UPCParsedResult upcResult = (UPCParsedResult) result; try { ContentURI uri = new ContentURI("http://www.upcdatabase.com/item.asp?upc=" + @@ -103,7 +103,7 @@ final class ResultHandler extends Handler { } catch (URISyntaxException e) { return; } - } else if (type == ParsedReaderResultType.URI) { + } else if (type.equals(ParsedReaderResultType.URI)) { URIParsedResult uriResult = (URIParsedResult) result; try { intent = new Intent(Intent.VIEW_ACTION, new ContentURI(uriResult.getURI()));