]> average.org Git - WhereAmI.git/commitdiff
make three attempts not just two
authorEugene Crosser <Eugene.Crosser@ru.ibm.com>
Fri, 10 Feb 2012 13:25:25 +0000 (17:25 +0400)
committerEugene Crosser <Eugene.Crosser@ru.ibm.com>
Fri, 10 Feb 2012 13:25:25 +0000 (17:25 +0400)
src/org/average/whereami/WhereAmI.java

index e3f510ea4a6ff641d4823abb7e319327f970ea20..be72fea52ef3a786de601cf69f4fc2891cf7220e 100644 (file)
@@ -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;