From: Eugene Crosser Date: Fri, 10 Feb 2012 13:25:25 +0000 (+0400) Subject: make three attempts not just two X-Git-Url: http://average.org/gitweb/?a=commitdiff_plain;h=78984664428e06a24ab837a005a9a6e5699960e6;p=WhereAmI.git make three attempts not just two --- 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;