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.

ClassCastException: LocalizationContext cannot be cast to android.app.ContextImpl on API 16 #65

Description

@varrav

Hi! On android API 16 I get such exception (and crash):

java.lang.RuntimeException: Unable to start receiver com.xxx.InactivityHandler: java.lang.ClassCastException: com.akexorcist.localizationactivity.core.LocalizationContext cannot be cast to android.app.ContextImpl
        at android.app.ActivityThread.handleReceiver(ActivityThread.java:2236)
        at android.app.ActivityThread.access$1500(ActivityThread.java:130)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4745)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
        at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.ClassCastException: com.akexorcist.localizationactivity.core.LocalizationContext cannot be cast to android.app.ContextImpl
        at android.app.ActivityThread.handleReceiver(ActivityThread.java:2226)
        at android.app.ActivityThread.access$1500(ActivityThread.java:130) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:137) 
        at android.app.ActivityThread.main(ActivityThread.java:4745) 
        at java.lang.reflect.Method.invokeNative(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:511) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
        at dalvik.system.NativeStart.main(Native Method)

InactivityHandler is defined in AndroidManifest as

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions