[Android] DB dump: extract hardcoded strings

Geoffrey Métais git at videolan.org
Thu Aug 8 13:53:44 CEST 2019


vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Aug  2 17:08:40 2019 +0200| [baa75df65add6ef66ff9b6d9fcbd897efb323303] | committer: Geoffrey Métais

DB dump: extract hardcoded strings

(cherry picked from commit 4d50750095c6704bbcb2a1c726ec02083142e7c9)

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

 vlc-android/res/values/strings.xml                                    | 2 ++
 .../src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt       | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index 4864cceb5..9fcc32c74 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -720,4 +720,6 @@
     <string name="validation_delete_playlist_text">This action cannot be undone.</string>
     <string name="display_in_list">Display in list</string>
     <string name="display_in_grid">Display in grid</string>
+    <string name="dump_db_succes">Database dumped on internal storage root</string>
+    <string name="dump_db_failure">Failed to dump database</string>
 </resources>
diff --git a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt
index cf3c72348..73493ad56 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt
@@ -111,12 +111,12 @@ class PreferencesAdvanced : BasePreferenceFragment(), SharedPreferences.OnShared
                             if (FileUtils.copyFile(db, File(AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY + AbstractMedialibrary.VLC_MEDIA_DB_NAME)))
                                 runOnMainThread(Runnable {
                                     val ctx = context
-                                    if (ctx != null) Toast.makeText(ctx, "Database dumped on internal storage root", Toast.LENGTH_LONG).show()
+                                    if (ctx != null) Toast.makeText(ctx, getString(R.string.dump_db_succes), Toast.LENGTH_LONG).show()
                                 })
                             else
                                 runOnMainThread(Runnable {
                                     val ctx = context
-                                    if (ctx != null) Toast.makeText(ctx, "Failed to dumped database", Toast.LENGTH_LONG).show()
+                                    if (ctx != null) Toast.makeText(ctx, getString(R.string.dump_db_failure), Toast.LENGTH_LONG).show()
                                 })
                         }
                         if (Permissions.canWriteStorage())



More information about the Android mailing list