Activity recreate method changed because it didn't work properly on Android older than 9

This commit is contained in:
r.zarchi 2022-04-05 10:42:18 +04:30
parent 47441a9837
commit c3d5928c1f

View file

@ -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)
}
}
}