mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-16 02:48:08 -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)
|
setContentView(activityKiwixErrorBinding!!.root)
|
||||||
val extras = intent.extras
|
val extras = intent.extras
|
||||||
exception = if (extras != null && safeContains(extras)) {
|
exception = if (extras != null && safeContains(extras)) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
extras.getSerializable(EXCEPTION_KEY, Throwable::class.java)
|
||||||
|
} else {
|
||||||
extras.getSerializable(EXCEPTION_KEY) as Throwable
|
extras.getSerializable(EXCEPTION_KEY) as Throwable
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user