ListView fails to process setSelection in some cases,
probably related to it being busy updating for a new
IndexAdapter.
Try to avoid this by posting the message to it instead
of to the uiHandler.
Might fix issue #120.
However the delay in jumpToTextFromHyperLink is still
needed, so this still is not really reliable.
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) {
Log.d(LOG, "More coming, waiting for currentSearchOperation.");
}
}
- }, 20);
+ });
}
private void jumpToRow(final int row) {