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.

java.lang.ClassCastException: android.app.ContextImpl in version 1.2.7 #94

@jonas-weinhardt

Description

@jonas-weinhardt

I have a simple App with just 2 Activities. One Is the Main Activity and the other is an Activity where the user can change the language. It gets opened when the user clicks a button on the Main Activity. Both Activities inherit from LocalizationActivity.
After the language gets changed the LanguageChange Activity gets finished to return to the Main Activity.

setLanguage("en");
finish();

Than the onResume function in the MainActivity gets triggered where I try to convert the Application Context to my Application class (witch inherits from LocalizationApplication):

@Override
protected void onResume() {
    super.onResume();
     App app = (App)getApplicationContext(); <-- java.lang.ClassCastException occures here 
}

Is there a way to get the right context at this point or am i doing something wrong?
Everything works by the way in version 1.2.6

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