[Android] AudioUtil: Show toast from main thread

Geoffrey Métais git at videolan.org
Fri Mar 1 15:07:39 CET 2019


vlc-android | branch: 3.1.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Mar  1 14:37:50 2019 +0100| [46cf13bbd560879548b503b4e67a336106e7def5] | committer: Geoffrey Métais

AudioUtil: Show toast from main thread

> https://code.videolan.org/videolan/vlc-android/commit/46cf13bbd560879548b503b4e67a336106e7def5
---

 vlc-android/src/org/videolan/vlc/gui/helpers/AudioUtil.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/helpers/AudioUtil.java b/vlc-android/src/org/videolan/vlc/gui/helpers/AudioUtil.java
index f43dc0b32..111cfa4ac 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/AudioUtil.java
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/AudioUtil.java
@@ -107,7 +107,12 @@ public class AudioUtil {
                     public void run() {
                         final File newRingtone = AndroidUtil.UriToFile(song.getUri());
                         if (!newRingtone.exists()) {
-                            Toast.makeText(context.getApplicationContext(),context.getString(R.string.ringtone_error), Toast.LENGTH_SHORT).show();
+                            WorkersKt.runOnMainThread(new Runnable() {
+                                @Override
+                                public void run() {
+                                    Toast.makeText(context.getApplicationContext(),context.getString(R.string.ringtone_error), Toast.LENGTH_SHORT).show();
+                                }
+                            });
                             return;
                         }
 



More information about the Android mailing list