mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-15 10:26:53 -04:00
Fixes of getSerializable() method of Intent is deprecated in android 13
This commit is contained in:
parent
bd09334b4f
commit
af67b0fc8c
@ -64,7 +64,11 @@ open class ErrorActivity : BaseActivity() {
|
||||
setContentView(activityKiwixErrorBinding!!.root)
|
||||
val extras = intent.extras
|
||||
exception = if (extras != null && safeContains(extras)) {
|
||||
extras.getSerializable(EXCEPTION_KEY) as Throwable
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
extras.getSerializable(EXCEPTION_KEY, Throwable::class.java)
|
||||
} else {
|
||||
extras.getSerializable(EXCEPTION_KEY) as Throwable
|
||||
}
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user