[Android] Fix locale setting not working anymore after updating appcompat

Nicolas Pomepuy git at videolan.org
Tue Mar 9 13:22:47 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Mar  9 14:14:10 2021 +0100| [1aa02d8b440ad06d36d6a499be2ce04a7e14bdb2] | committer: Nicolas Pomepuy

Fix locale setting not working anymore after updating appcompat

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

 application/vlc-android/src/org/videolan/vlc/gui/BaseActivity.kt       | 3 ++-
 .../vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt  | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/BaseActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/BaseActivity.kt
index b1077477a..9479404ea 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/BaseActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/BaseActivity.kt
@@ -41,7 +41,8 @@ abstract class BaseActivity : AppCompatActivity() {
 
     override fun attachBaseContext(newBase: Context?) {
         super.attachBaseContext(newBase?.getContextWithLocale(AppContextProvider.locale))
-    }
+        applyOverrideConfiguration(newBase?.resources?.configuration)
+  }
 
     override fun getApplicationContext(): Context {
         return super.getApplicationContext().getContextWithLocale(AppContextProvider.locale)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index 172e33128..f00ef2b2d 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -362,6 +362,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
 
     override fun attachBaseContext(newBase: Context?) {
         super.attachBaseContext(newBase?.getContextWithLocale(AppContextProvider.locale))
+        applyOverrideConfiguration(newBase?.resources?.configuration)
     }
 
     override fun getApplicationContext(): Context {



More information about the Android mailing list