Activity recreate method changed because it didn't work properly on Android older than 9
@@ -5,6 +5,7 @@ import android.os.Bundle
import androidx.annotation.LayoutRes
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
+import androidx.core.app.ActivityCompat
import androidx.lifecycle.asLiveData
import com.fsck.k9.controller.push.PushController
import java.util.Locale
@@ -40,7 +41,7 @@ abstract class K9Activity(private val themeType: ThemeType) : AppCompatActivity(
private fun listenForAppLanguageChanges() {
appLanguageManager.overrideLocale.asLiveData().observe(this) { overrideLocale ->
if (overrideLocale != overrideLocaleOnLaunch) {
- recreate()
+ ActivityCompat.recreate(this)
}
}
}
