Skip to content
This repository was archived by the owner on Jun 22, 2022. It is now read-only.
This repository was archived by the owner on Jun 22, 2022. It is now read-only.

Crash on checkLocaleChange #136

@julienherrero

Description

@julienherrero

Because of the lateinit var, currentLanguage can be used before its initialization :

2022-04-26 11:54:34.654 4223-4223/com.tabesto.myapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.tabesto.myapp, PID: 4223
    kotlin.UninitializedPropertyAccessException: lateinit property currentLanguage has not been initialized
        at com.akexorcist.localizationactivity.core.LocalizationActivityDelegate.checkLocaleChange(LocalizationActivityDelegate.kt:175)
        at com.akexorcist.localizationactivity.core.LocalizationActivityDelegate.access$checkLocaleChange(LocalizationActivityDelegate.kt:12)
        at com.akexorcist.localizationactivity.core.LocalizationActivityDelegate$onResume$1.run(LocalizationActivityDelegate.kt:37)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:246)
        at android.app.ActivityThread.main(ActivityThread.java:8653)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

You can facing this issue by using Direct-Boot : with this, we cannot initialize language before first onResume() call.

I've submited a PR to fix this : #135

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions