]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/DictionaryActivity.java
Attempt to fix search sometimes not working.
[Dictionary.git] / src / com / hughes / android / dictionary / DictionaryActivity.java
index 12839caeddcf3d6c351e0a2a137fe4508c38fc1a..77454f9a3e0032af41d5b056de722c577747fdc2 100644 (file)
@@ -1351,7 +1351,9 @@ public class DictionaryActivity extends AppCompatActivity {
         Log.d(LOG, "searchFinished: " + searchOperation + ", searchResult=" + searchResult);
 
         currentSearchOperation = null;
-        uiHandler.postDelayed(new Runnable() {
+        // Note: it's important to post to the ListView, otherwise
+        // the jumpToRow will randomly not work.
+        getListView().post(new Runnable() {
             @Override
             public void run() {
                 if (currentSearchOperation == null) {
@@ -1370,7 +1372,7 @@ public class DictionaryActivity extends AppCompatActivity {
                     Log.d(LOG, "More coming, waiting for currentSearchOperation.");
                 }
             }
-        }, 20);
+        });
     }
 
     private void jumpToRow(final int row) {