load the default Application theme on startup

This commit is contained in:
Julian Winkler
2023-08-22 13:27:28 +02:00
parent 34d214e9ae
commit 83cc2e5991
2 changed files with 4 additions and 1 deletions

View File

@@ -100,6 +100,9 @@ public class Context extends Object {
Class<? extends Application> cls = Class.forName(className).asSubclass(Application.class); Class<? extends Application> cls = Class.forName(className).asSubclass(Application.class);
Constructor<? extends Application> constructor = cls.getConstructor(); Constructor<? extends Application> constructor = cls.getConstructor();
application = constructor.newInstance(); application = constructor.newInstance();
ResXmlAttribute application_theme = manifest.getApplicationElement().searchAttributeByResourceId(AndroidManifestBlock.ID_theme);
if (application_theme != null)
application.setTheme(application_theme.getData());
this_application = application; this_application = application;
return application; return application;
} }

View File

@@ -1211,7 +1211,7 @@ public class Resources {
* if not already defined in the theme. * if not already defined in the theme.
*/ */
public void applyStyle(int resid, boolean force) { public void applyStyle(int resid, boolean force) {
themeMap = mAssets.loadStyle(resid); themeMap.putAll(mAssets.loadStyle(resid));
} }
/** /**