diff --git a/app/src/main/java/com/github/libretube/MainActivity.kt b/app/src/main/java/com/github/libretube/MainActivity.kt index 10558023e..49a497a30 100644 --- a/app/src/main/java/com/github/libretube/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/MainActivity.kt @@ -41,7 +41,6 @@ class MainActivity : AppCompatActivity() { val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this) RetrofitInstance.url = sharedPreferences.getString("instance", "https://pipedapi.kavin.rocks/")!! DynamicColors.applyToActivitiesIfAvailable(application) - setContentView(R.layout.activity_main) val languageName = sharedPreferences.getString("language", "sys") if (languageName != "") { var locale = if (languageName != "sys") { @@ -56,6 +55,7 @@ class MainActivity : AppCompatActivity() { Locale.setDefault(locale) res.updateConfiguration(conf, dm) } + setContentView(R.layout.activity_main) when (sharedPreferences.getString("theme_togglee", "A")!!) { "A" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) "L" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)