[Android] Fix crash on TV when clearing DB

Geoffrey Métais git at videolan.org
Fri Jan 15 16:38:51 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Jan 15 16:31:34 2016 +0100| [ae1780781eed7cc2e83093008b2d325f3e9cd366] | committer: Geoffrey Métais

Fix crash on TV when clearing DB

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

 vlc-android/src/org/videolan/vlc/gui/preferences/Advanced.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/preferences/Advanced.java b/vlc-android/src/org/videolan/vlc/gui/preferences/Advanced.java
index e13bff0..c6cfb14 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/Advanced.java
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/Advanced.java
@@ -32,6 +32,7 @@ import android.support.v7.preference.ListPreference;
 import android.support.v7.preference.Preference;
 import android.support.v7.preference.PreferenceManager;
 import android.text.TextUtils;
+import android.widget.Toast;
 
 import org.videolan.libvlc.util.HWDecoderUtil;
 import org.videolan.vlc.BuildConfig;
@@ -161,7 +162,10 @@ public class Advanced extends BasePreferenceFragment implements SharedPreference
                 BitmapCache.getInstance().clear();
                 AudioUtil.clearCacheFolders();
                 getActivity().setResult(PreferencesActivity.RESULT_RESCAN);
-                UiTools.snacker(getView(), R.string.media_db_cleared);
+                if (BuildConfig.tv)
+                    Toast.makeText(getActivity(), R.string.media_db_cleared, Toast.LENGTH_SHORT).show();
+                else
+                    UiTools.snacker(getView(), R.string.media_db_cleared);
                 return true;
             case "quit_app":
                 android.os.Process.killProcess(android.os.Process.myPid());



More information about the Android mailing list