locale bug
change locale to for example fr and restart the VLC. every thing seems ok go to the settings every thing changed from english to fr. go to the about then go again to settings , every thing is English again.
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Author Contributor
and also this happens when rotating device.
- Author Contributor
I found the reason: the first one is because of WebView in android 7 : https://stackoverflow.com/questions/40398528/android-webview-locale-changes-abruptly-on-android-n
and the second one can be fixed by setting locale in onConfigurationChanged in VLCApplication.
I'm working on a patch to fix them.
- Habib Kazemi closed via commit 41a4049a
closed via commit 41a4049a
- Author Contributor
This is also happens when using android 7 multiWindow.
- Habib Kazemi reopened
reopened
- Maintainer
Fixed my modification. I made an additional commit to not interfere the 2.1.10 tag. Thanks for your contribution.
2 - Geoffrey Métais closed
closed
- Author Contributor
@Dekans I reopened this Issue because I found that this is also happens when using android 7 multiWindow #285 (comment 7478) :)
- Maintainer
Oh yes sorry. Even with your patch?
- Author Contributor
yes , I'm looking for a reason and a solution for that.
- Author Contributor
I don't know why this happens but I find a way to fix it. Android 7 has a new method https://developer.android.com/reference/android/app/Activity.html#onMultiWindowModeChanged(boolean) (it's deprecated in android O !!)
I tried
@Override public void onMultiWindowModeChanged(boolean isInMultiWindowMode) { super.onMultiWindowModeChanged(isInMultiWindowMode); if(isInMultiWindowMode){ VLCApplication.setLocale(this); Log.d(TAG,"multiWindow"); } }
but this didn't help because of this
06-02 17:33:20.550 23410-23410/org.videolan.vlc.debug D/VLC/MainActivity: onCreate 06-02 17:33:21.005 23410-23410/org.videolan.vlc.debug D/VLC/MainActivity: onStart 06-02 17:33:21.011 23410-23410/org.videolan.vlc.debug D/VLC/MainActivity: onResume ====> 06-02 17:33:25.434 23410-23410/org.videolan.vlc.debug D/VLC/MainActivity: multiWindow <======= 06-02 17:33:25.808 23410-23410/org.videolan.vlc.debug D/VLC/MainActivity: onPause 06-02 17:33:26.081 23410-23410/org.videolan.vlc.debug D/VLC/MainActivity: onStop 06-02 17:33:26.107 23410-23410/org.videolan.vlc.debug D/VLC/MainActivity: onCreate 06-02 17:33:26.269 23410-23410/org.videolan.vlc.debug D/VLC/MainActivity: onStart 06-02 17:33:26.275 23410-23410/org.videolan.vlc.debug D/VLC/MainActivity: onResume 06-02 17:33:26.280 23410-23410/org.videolan.vlc.debug D/VLC/MainActivity: onPause
after calling
onMultiWindowModeChanged
it will stop activity and recreate it so I tried addingVLCApplication.setLocale(this);
aftersetContentView()
:setContentView(R.layout.main); VLCApplication.setLocale(this);
in
onCreate
and the problem fixed. But I don't know if it's the only solution or not, with this method we should update all activities.Edited by Habib Kazemi - Habib Kazemi reopened
reopened
- Maintainer
All activities inherit from AudioPlayerContainerActivity or BaseTvActivity. We could trigger it in onPostCreate() and that would be done.
But it seems excessive to set locale at every activity creation.
- Habib Kazemi mentioned in commit Dekans/vlc-android@41a4049a
mentioned in commit Dekans/vlc-android@41a4049a
- Maintainer
I guess we can apply:
if (savedInstanceState != null) VLCApplication.setLocale(this);
to limit this call at activity re-creations.
Edited by Geoffrey Métais - Maintainer
Any news about this?
- Author Contributor
I didn't try yet but I guess your previous idea really works because we have the
isInMultiWindowModedata
data usingpublic void onMultiWindowModeChanged(boolean isInMultiWindowMode) {}
(calling before onPause) and we can use that data and put it in thesavedinstanceState
bundle and detect that we shouldsetLocale
in next creation. - Maintainer
Do you see improvements for multiwindow with 2.1.14?
- Author Contributor
No, I don't see any improvement in my device. The commit was this one right ? 442134d8
- Maintainer
Yes.