akexorcist / Localization

[Android] In-app language changing library
Apache License 2.0
983 stars 154 forks source link

Caused by android.os.BadParcelableException Parcelable protocol requires subclassing from Parcelable on class o.bsc com.akexorcist.localizationactivity.core.LocalizationActivityDelegate.checkBeforeLocaleChanging #92

Open kyh8496 opened 3 years ago

kyh8496 commented 3 years ago

I'm using 1.2.6 version

com.akexorcist.localizationactivity.core.LocalizationActivityDelegate.checkBeforeLocaleChanging (LocalizationActivityDelegate.java:140)

error line code : activity.intent.getBooleanExtra(KEY_ACTIVITY_LOCALE_CHANGED, false)

This is an issue I discovered through Firebase Crashlytics. The issue occurs intermittently

akexorcist commented 3 years ago

@kyh8496 In v1.2.7, there's pull request from #83. That might solve this issue. Please check it out.

akexorcist commented 3 years ago

I close this issue because there's no response for a month. If you still have a problem, please feel free to re-open it.

kyh8496 commented 3 years ago

The issue still occurs in version 1.2.9. BadParcelableException when try getBooleanExtra

i think that it needs to try catch BadParcelableException the line

private fun checkBeforeLocaleChanging() { val isLocalizationChanged = activity.intent?.getBooleanExtra(KEY_ACTIVITY_LOCALE_CHANGED, false) ?: false if (isLocalizationChanged) { this.isLocalizationChanged = true activity.intent?.removeExtra(KEY_ACTIVITY_LOCALE_CHANGED) } }

kyh8496 commented 3 years ago

83 PR was checked. But it hasn't been solved. It seems to be a problem that occurs when the Intent is not null.

akexorcist commented 3 years ago

1.2.10 is live. please check on your project and don't forget to give me a feedback.

akexorcist commented 2 years ago

Since AndroidX AppCompat has per-app language preferences for backward compatibility. Please migrate this library to AndroidX for more stability, compatibility, and longer support from Google team.

See Migrate to AndroidX guide

Thank you for your support