Assigned
Status Update
Comments
hi...@gmail.com <hi...@gmail.com> #2
Forgot to note the environment.
This crash occurs on only API 21.
This crash occurs on only API 21.
eg...@gmail.com <eg...@gmail.com> #3
This crash occurs on API 22 and 23 when the user doesn't have Google Play installed. Related discussions: https://stackoverflow.com/q/41025200/842697
pa...@gmail.com <pa...@gmail.com> #5
For me this still persisted in 1.1.0-rc01 as well as 1.1.0-alpha01.
Only downgrading all my androidx version to the previously working state helped.
From:
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha10'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta04'
implementation 'androidx.viewpager2:viewpager2:1.0.0-beta04'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.core:core:1.2.0-alpha04'
back to:
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha09'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta03'
implementation 'androidx.viewpager2:viewpager2:1.0.0-beta03'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0-rc01'
implementation 'androidx.preference:preference:1.1.0-rc01'
implementation 'androidx.core:core:1.2.0-alpha03'
Only downgrading all my androidx version to the previously working state helped.
From:
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha10'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta04'
implementation 'androidx.viewpager2:viewpager2:1.0.0-beta04'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.core:core:1.2.0-alpha04'
back to:
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha09'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta03'
implementation 'androidx.viewpager2:viewpager2:1.0.0-beta03'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0-rc01'
implementation 'androidx.preference:preference:1.1.0-rc01'
implementation 'androidx.core:core:1.2.0-alpha03'
pa...@gmail.com <pa...@gmail.com> #6
If you want to use 1.1.0 , override applyOverrideConfiguration in your activity as follows. However, this might need app restart for API 21 to 25, while switching Dark Theme to Light Theme and vice versa.
override fun applyOverrideConfiguration(overrideConfiguration: Configuration?) {
if (Build.VERSION.SDK_INT in 21..25 && (resources.configuration.uiMode == AppConstants.appContext.resources.configuration.uiMode)) {
return
}
super.applyOverrideConfiguration(overrideConfiguration)
}
override fun applyOverrideConfiguration(overrideConfiguration: Configuration?) {
if (Build.VERSION.SDK_INT in 21..25 && (resources.configuration.uiMode == AppConstants.appContext.resources.configuration.uiMode)) {
return
}
super.applyOverrideConfiguration(overrideConfiguration)
}
ep...@gmail.com <ep...@gmail.com> #7
Any update? Issue reproduces with androidx.appcompat:appcompat:1.1.0...
Description
Version used: 1.6.0
Devices/Android versions reproduced on: Samsung Galaxy S8+ with Android 9; Samsung Galaxy Tab S7 FE with Android 13
We have an in-app language picker and we would like to switch to the new API for saving the user selected language.
Unfortunately whenever calling AppCompatDelegate.setApplicationLocales(appLocale), a black screen is shown before the activity is updated.
This also happens with the sample found here
As I understood from my research this happens because the Activity is being recreated, but seeing a black screen for a few seconds when user changes the locale does not seem like a good user experience to me.
Is there something we could do to avoid this "black screen" when saving the language with AppCompatDelegate.setApplicationLocales(appLocale) method? Setting android:windowBackground property for the activity theme does not have any effect.
Thank you for your help!