From 8950c600bb6e3804b79c62e83fef2253c2cc2389 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Fri, 16 Jul 2021 19:45:22 +0200 Subject: [PATCH] fix(android): Set theme an content view on onCreate (#4841) --- .../src/main/java/com/getcapacitor/BridgeActivity.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/BridgeActivity.java b/android/capacitor/src/main/java/com/getcapacitor/BridgeActivity.java index 651aeba70e..18a7ea07e5 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/BridgeActivity.java +++ b/android/capacitor/src/main/java/com/getcapacitor/BridgeActivity.java @@ -22,6 +22,10 @@ public class BridgeActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); bridgeBuilder.setInstanceState(savedInstanceState); + getApplication().setTheme(getResources().getIdentifier("AppTheme_NoActionBar", "style", getPackageName())); + setTheme(getResources().getIdentifier("AppTheme_NoActionBar", "style", getPackageName())); + setTheme(R.style.AppTheme_NoActionBar); + setContentView(R.layout.bridge_layout_main); } /** @@ -63,11 +67,6 @@ protected void load(Bundle savedInstanceState) { } private void load() { - getApplication().setTheme(getResources().getIdentifier("AppTheme_NoActionBar", "style", getPackageName())); - setTheme(getResources().getIdentifier("AppTheme_NoActionBar", "style", getPackageName())); - setTheme(R.style.AppTheme_NoActionBar); - setContentView(R.layout.bridge_layout_main); - Logger.debug("Starting BridgeActivity"); bridge = bridgeBuilder.addPlugins(initialPlugins).setConfig(config).create();