[Android] Clear data app directly from Android app info view
Alexandre Perraud
git at videolan.org
Fri Feb 10 16:35:52 CET 2017
vlc-android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Fri Feb 10 16:32:39 2017 +0100| [7d91be5b9bef7d93ba5d15e551c13e199fb19e26] | committer: Alexandre Perraud
Clear data app directly from Android app info view
> https://code.videolan.org/videolan/vlc-android/commit/7d91be5b9bef7d93ba5d15e551c13e199fb19e26
---
vlc-android/res/values/strings.xml | 1 +
vlc-android/res/xml/preferences_adv.xml | 1 +
.../videolan/vlc/gui/preferences/PreferencesAdvanced.java | 12 +++++-------
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 189e8f2..0f98f1e 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -357,6 +357,7 @@
<string name="auto_rescan">Auto rescan</string>
<string name="auto_rescan_summary">Automatically scan device for new or deleted media at application startup</string>
<string name="clear_media_db">Clear media database</string>
+ <string name="clear_media_db_summary">Access Android VLC info to clear data</string>
<string name="clear_history">Clear search history</string>
<string name="media_db_cleared">Media database cleared!</string>
<string name="set_locale">Set locale</string>
diff --git a/vlc-android/res/xml/preferences_adv.xml b/vlc-android/res/xml/preferences_adv.xml
index dd73a2a..3942cd0 100644
--- a/vlc-android/res/xml/preferences_adv.xml
+++ b/vlc-android/res/xml/preferences_adv.xml
@@ -19,6 +19,7 @@
<Preference
android:enabled="true"
android:key="clear_media_db"
+ android:summary="@string/clear_media_db_summary"
android:title="@string/clear_media_db" />
<PreferenceScreen
diff --git a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.java b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.java
index 0d6ab62..8d6d060 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.java
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.java
@@ -28,6 +28,7 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
+import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.preference.EditTextPreference;
@@ -36,12 +37,9 @@ import android.text.TextUtils;
import org.videolan.libvlc.util.AndroidUtil;
import org.videolan.vlc.BuildConfig;
-import org.videolan.vlc.MediaParsingService;
import org.videolan.vlc.R;
import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.DebugLogActivity;
-import org.videolan.vlc.gui.helpers.AudioUtil;
-import org.videolan.vlc.gui.helpers.BitmapCache;
import org.videolan.vlc.gui.helpers.UiTools;
import org.videolan.vlc.util.VLCInstance;
@@ -106,10 +104,10 @@ public class PreferencesAdvanced extends BasePreferenceFragment implements Share
.setNegativeButton(android.R.string.cancel, null).show();
return true;
case "clear_media_db":
- getActivity().startService(new Intent(MediaParsingService.ACTION_RELOAD, null, getActivity(), MediaParsingService.class));
- BitmapCache.getInstance().clear();
- AudioUtil.clearCacheFolders();
- UiTools.snacker(getView(), R.string.media_db_cleared);
+ Intent i = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
+ i.addCategory(Intent.CATEGORY_DEFAULT);
+ i.setData(Uri.parse("package:" + VLCApplication.getAppContext().getPackageName()));
+ startActivity(i);
return true;
case "quit_app":
android.os.Process.killProcess(android.os.Process.myPid());
More information about the Android
mailing list