diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/AudioPlayer.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AudioPlayer.java b/src/main/java/de/pixart/messenger/services/AudioPlayer.java index ca6e7c3fa..64a1ea787 100644 --- a/src/main/java/de/pixart/messenger/services/AudioPlayer.java +++ b/src/main/java/de/pixart/messenger/services/AudioPlayer.java @@ -23,6 +23,8 @@ import android.widget.TextView; import java.lang.ref.WeakReference; import java.util.Locale; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import de.pixart.messenger.Config; import de.pixart.messenger.R; @@ -44,6 +46,7 @@ public class AudioPlayer implements View.OnClickListener, MediaPlayer.OnCompleti private final SensorManager sensorManager; private final Sensor proximitySensor; private final PendingItem<WeakReference<ImageButton>> pendingOnClickView = new PendingItem<>(); + private final ExecutorService executor = Executors.newSingleThreadExecutor(); private final Handler handler = new Handler(); @@ -86,7 +89,7 @@ public class AudioPlayer implements View.OnClickListener, MediaPlayer.OnCompleti audioPlayer.setTag(message); if (init(ViewHolder.get(audioPlayer), message)) { this.audioPlayerLayouts.addWeakReferenceTo(audioPlayer); - this.stopRefresher(true); + executor.execute(()-> this.stopRefresher(true)); } else { this.audioPlayerLayouts.removeWeakReferenceTo(audioPlayer); } |