|
9 | 9 | import android.graphics.Typeface; |
10 | 10 | import android.graphics.drawable.Drawable; |
11 | 11 | import android.os.Handler; |
| 12 | +import android.os.Looper; |
12 | 13 | import android.text.Spannable; |
13 | 14 | import android.text.SpannableString; |
14 | 15 | import android.text.style.ForegroundColorSpan; |
@@ -395,7 +396,7 @@ protected final void recordLaunch(Context context, @Nullable QueryInterface quer |
395 | 396 | // * to ensure the animation runs smoothly |
396 | 397 | // * to avoid a flickering -- launchOccurred will refresh the list |
397 | 398 | // Thus TOUCH_DELAY * 3 |
398 | | - Handler handler = new Handler(); |
| 399 | + Handler handler = new Handler(Looper.getMainLooper()); |
399 | 400 | handler.postDelayed(() -> { |
400 | 401 | if (queryInterface != null) { |
401 | 402 | queryInterface.launchOccurred(); |
@@ -596,7 +597,7 @@ protected void setTranscriptModeAlwaysScroll(RecordAdapter adapter) { |
596 | 597 | // We'll need to reset the list view to its previous transcript mode, |
597 | 598 | // but it has to happen *after* the keyboard is hidden, otherwise scroll will be reset |
598 | 599 | // Let's wait for half a second, that's ugly but we don't have any other option :( |
599 | | - final Handler handler = new Handler(); |
| 600 | + final Handler handler = new Handler(Looper.getMainLooper()); |
600 | 601 | handler.postDelayed(() -> adapter.updateTranscriptMode(AbsListView.TRANSCRIPT_MODE_ALWAYS_SCROLL), 500); |
601 | 602 | } |
602 | 603 |
|
|
0 commit comments