From e7b14f744320d087e0d60e69c1fa88a30517df37 Mon Sep 17 00:00:00 2001 From: dswitkin Date: Thu, 12 May 2011 15:03:03 +0000 Subject: [PATCH] Issue 250: Provided a choice of creating a new contact or merging with an existing one. git-svn-id: https://zxing.googlecode.com/svn/trunk@1768 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- android/assets/html/whatsnew.html | 1 + .../zxing/client/android/result/ResultHandler.java | 14 +++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/android/assets/html/whatsnew.html b/android/assets/html/whatsnew.html index 395bc7476..b34ac8b98 100644 --- a/android/assets/html/whatsnew.html +++ b/android/assets/html/whatsnew.html @@ -10,6 +10,7 @@
  • Added support for many more locales for web search and product search.
  • Added Hebrew translation.
  • Fixed support for the Motorola Xoom tablet.
  • +
  • Provided a choice of creating a new contact or merging with an existing one.
  • Other minor fixes.
  • New in version 3.53:

    diff --git a/android/src/com/google/zxing/client/android/result/ResultHandler.java b/android/src/com/google/zxing/client/android/result/ResultHandler.java index 5f76219e8..f8df9ed14 100644 --- a/android/src/com/google/zxing/client/android/result/ResultHandler.java +++ b/android/src/com/google/zxing/client/android/result/ResultHandler.java @@ -238,20 +238,12 @@ public abstract class ResultHandler { } } - private static long lastSecondOfDay(long time) { - Calendar timeInDay = Calendar.getInstance(); - timeInDay.setTimeInMillis(time); - timeInDay.set(Calendar.HOUR_OF_DAY, timeInDay.getActualMaximum(Calendar.HOUR_OF_DAY)); - timeInDay.set(Calendar.MINUTE, timeInDay.getActualMaximum(Calendar.MINUTE)); - timeInDay.set(Calendar.SECOND, timeInDay.getActualMaximum(Calendar.SECOND)); - return timeInDay.getTimeInMillis(); - } - final void addContact(String[] names, String[] phoneNumbers, String[] emails, String note, String address, String org, String title) { // Only use the first name in the array, if present. - Intent intent = new Intent(Contacts.Intents.Insert.ACTION, Contacts.People.CONTENT_URI); + Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT, Contacts.CONTENT_URI); + intent.setType(Contacts.People.CONTENT_ITEM_TYPE); putExtra(intent, Contacts.Intents.Insert.NAME, names != null ? names[0] : null); int phoneCount = Math.min((phoneNumbers != null) ? phoneNumbers.length : 0, @@ -470,4 +462,4 @@ public abstract class ResultHandler { return url; } -} \ No newline at end of file +}