Android Changing Activity Theme onCreate


#1

I want to change the android:theme during runtime depending on some conditions. I have tried extending the Android Activity following: https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/extend-application-activity#extending-activity

        if (!this._callbacks) {
            setActivityCallbacks(this);
        }
        const id = this.getResources().getIdentifier("Theme", "style",  this.getPackageName());
        this.setTheme(id);
        this._callbacks.onCreate(this, savedInstanceState, super.onCreate);
// If I put: super.onCreate(savedInstanceState) instead of  ^ the theme will change, but never disappears. 
    }

What exactly is the difference between calling just super and the callback? By using super I can change the theme, but it never disappears. As for the callback it seems to just ignore the theme I am trying to set regardless if I set it before or after the callback.


#2

May I know what you mean by it never disappears?


#3

Sorry, I was very vague. The theme I set (in this case for testing I put the splash screen) is the only thing visible and at that point in the log I notice that nothing is outputted as though the app is frozen.