From 78984664428e06a24ab837a005a9a6e5699960e6 Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Fri, 10 Feb 2012 17:25:25 +0400 Subject: [PATCH] make three attempts not just two --- src/org/average/whereami/WhereAmI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/average/whereami/WhereAmI.java b/src/org/average/whereami/WhereAmI.java index e3f510e..be72fea 100644 --- a/src/org/average/whereami/WhereAmI.java +++ b/src/org/average/whereami/WhereAmI.java @@ -56,12 +56,12 @@ public class WhereAmI extends Activity protected String doInBackground(Void... params) { Log.v(TAG, "BgUpdate " + updater + " starting"); Utterance result = updater.getResult(); - if (!result.success) { + for (int i = 2; !result.success && i <= 3; i++) { SystemClock.sleep(1000 + random.nextInt(1000)); result = updater.getResult(); } if (!result.success) { - Log.e(TAG, "After second attempt still " + + Log.e(TAG, "After third attempt still " + result.message); } return result.message; -- 2.43.0