Fix for the progress indicator not spinning
diff --git a/src/com/android/browser/TitleBar.java b/src/com/android/browser/TitleBar.java
index fea9baf..3bdc18b 100644
--- a/src/com/android/browser/TitleBar.java
+++ b/src/com/android/browser/TitleBar.java
@@ -181,7 +181,7 @@
      * Update the progress, from 0 to 100.
      */
     /* package */ void setProgress(int newProgress) {
-        if (newProgress == mHorizontalProgress.getMax()) {
+        if (newProgress >= mHorizontalProgress.getMax()) {
             mTitle.setCompoundDrawables(null, null, null, null);
             ((Animatable) mCircularProgress).stop();
             mHorizontalProgress.setVisibility(View.INVISIBLE);
@@ -191,7 +191,11 @@
             mInLoad = false;
         } else {
             mHorizontalProgress.setProgress(newProgress);
-            if (!mInLoad) {
+            if (!mInLoad && getWindowToken() != null) {
+                // checking the window token lets us be sure that we
+                // are attached to a window before starting the animation,
+                // preventing a potential race condition
+                // (fix for bug http://b/2115736)
                 mTitle.setCompoundDrawables(null, null, mCircularProgress,
                         null);
                 ((Animatable) mCircularProgress).start();